@matheusbsbs / matheus-bagliano / commits / a23bfaed7d
Fork 0

More echo "$user_message" fixes.

Here are fixes to more uses of 'echo "$msg"' where $msg could contain backslashed sequence. Signed-off-by: Junio C Hamano <junkio@cox.net>

Jeff King committed May 26, 2007 at 00:33 UTC a23bfaed7da90ccdc75cbfd0099741080381f60a
3 files changed +6 -6
git-am.sh
+2 -2
@@ -18,7 +18,7 @@ stop_here () {
18
19 stop_here_user_resolve () {
20 if [ -n "$resolvemsg" ]; then
21 - echo "$resolvemsg"
21 + printf '%s\n' "$resolvemsg"
22 stop_here $1
23 fi
24 cmdline=$(basename $0)
@@ -146,7 +146,7 @@ do
146 git_apply_opt="$git_apply_opt $1"; shift ;;
147
148 --resolvemsg=*)
149 - resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
149 + resolvemsg=${1#--resolvemsg=}; shift ;;
150
151 --)
152 shift; break ;;
git-merge.sh
+3 -3
@@ -328,7 +328,7 @@ f,*)
328 then
329 echo "Wonderful."
330 result_commit=$(
331 - echo "$merge_msg" |
331 + printf '%s\n' "$merge_msg" |
332 git-commit-tree $result_tree -p HEAD -p "$1"
333 ) || exit
334 finish "$result_commit" "In-index merge"
@@ -433,7 +433,7 @@ done
433 if test '' != "$result_tree"
434 then
435 parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
436 - result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
436 + result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit
437 finish "$result_commit" "Merge made by $wt_strategy."
438 dropsave
439 exit 0
@@ -472,7 +472,7 @@ else
472 do
473 echo $remote
474 done >"$GIT_DIR/MERGE_HEAD"
475 - echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
475 + printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG"
476 fi
477
478 if test "$merge_was_ok" = t
git-tag.sh
+1 -1
@@ -126,7 +126,7 @@ if [ "$annotate" ]; then
126 echo "#" ) > "$GIT_DIR"/TAG_EDITMSG
127 ${VISUAL:-${EDITOR:-vi}} "$GIT_DIR"/TAG_EDITMSG || exit
128 else
129 - echo "$message" >"$GIT_DIR"/TAG_EDITMSG
129 + printf '%s\n' "$message" >"$GIT_DIR"/TAG_EDITMSG
130 fi
131
132 grep -v '^#' <"$GIT_DIR"/TAG_EDITMSG |