diff options
author | Junio C Hamano <junkio@cox.net> | 2007-05-25 22:00:54 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-26 00:23:23 -0700 |
commit | 293623edbc9488adbc71c2e0de1100b52cb193ac (patch) | |
tree | a5b4ebef30dda104fbdceaf203570a83a8cbfe87 /git-commit.sh | |
parent | 4b7cc26a74b01ceab14a32ef66704557b26d5622 (diff) | |
download | git-293623edbc9488adbc71c2e0de1100b52cb193ac.tar.gz |
git-commit: use printf '%s\n' instead of echo on user-supplied strings
This fixes the same issue git-am had, which was fixed by Jeff
King in the previous commit. Cleverly enough, this commit's log
message is a good test case at the same time.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-x | git-commit.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git-commit.sh b/git-commit.sh index 292cf967e3..a1884fed25 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -376,12 +376,12 @@ t,) rm -f "$TMP_INDEX" fi || exit - echo "$commit_only" | + printf '%s\n' "$commit_only" | GIT_INDEX_FILE="$TMP_INDEX" \ git-update-index --add --remove --stdin && save_index && - echo "$commit_only" | + printf '%s\n' "$commit_only" | ( GIT_INDEX_FILE="$NEXT_INDEX" export GIT_INDEX_FILE @@ -432,7 +432,7 @@ fi if test "$log_message" != '' then - echo "$log_message" + printf '%s\n' "$log_message" elif test "$logfile" != "" then if test "$logfile" = - @@ -475,7 +475,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then echo "#" echo "# It looks like you may be committing a MERGE." echo "# If this is not correct, please remove the file" - echo "# $GIT_DIR/MERGE_HEAD" + printf '%s\n' "# $GIT_DIR/MERGE_HEAD" echo "# and try again" echo "#" fi >>"$GIT_DIR"/COMMIT_EDITMSG |