Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 9cbd46a

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

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ rearrange_squash () {
739739
;;
740740
esac
741741
done
742-
echo "$sha1 $action $prefix $rest"
742+
printf '%s %s %s %s\n' "$sha1" "$action" "$prefix" "$rest"
743743
# if it's a single word, try to resolve to a full sha1 and
744744
# emit a second copy. This allows us to match on both message
745745
# and on sha1 prefix

t/test-lib.sh

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

278278
if test "$help" = "t"
279279
then
280-
echo "$test_description"
280+
printf '%s\n' "$test_description"
281281
exit 0
282282
fi
283283

@@ -328,7 +328,7 @@ test_failure_ () {
328328
test_failure=$(($test_failure + 1))
329329
say_color error "not ok $test_count - $1"
330330
shift
331-
echo "$@" | sed -e 's/^/# /'
331+
printf '%s\n' "$*" | sed -e 's/^/# /'
332332
test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
333333
}
334334

0 commit comments

Comments
 (0)