Skip to content

Commit cf30bfb

Browse files
committed
Merge branch 'us/printf-not-echo'
* us/printf-not-echo: test-lib.sh: do not "echo" caller-supplied strings rebase -i: do not "echo" random user-supplied strings
2 parents 3e33860 + cb1aefd commit cf30bfb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

git-rebase--interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ rearrange_squash () {
749749
;;
750750
esac
751751
done
752-
echo "$sha1 $action $prefix $rest"
752+
printf '%s %s %s %s\n' "$sha1" "$action" "$prefix" "$rest"
753753
# if it's a single word, try to resolve to a full sha1 and
754754
# emit a second copy. This allows us to match on both message
755755
# and on sha1 prefix

t/test-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ error "Test script did not set test_description."
283283

284284
if test "$help" = "t"
285285
then
286-
echo "$test_description"
286+
printf '%s\n' "$test_description"
287287
exit 0
288288
fi
289289

@@ -334,7 +334,7 @@ test_failure_ () {
334334
test_failure=$(($test_failure + 1))
335335
say_color error "not ok $test_count - $1"
336336
shift
337-
echo "$@" | sed -e 's/^/# /'
337+
printf '%s\n' "$*" | sed -e 's/^/# /'
338338
test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
339339
}
340340

0 commit comments

Comments
 (0)