Skip to content

Commit

Permalink
More echo "$user_message" fixes.
Browse files Browse the repository at this point in the history
Here are fixes to more uses of 'echo "$msg"' where $msg could contain
backslashed sequence.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Jeff King authored and Junio C Hamano committed May 26, 2007
1 parent 816366e commit a23bfae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stop_here () {

stop_here_user_resolve () {
if [ -n "$resolvemsg" ]; then
echo "$resolvemsg"
printf '%s\n' "$resolvemsg"
stop_here $1
fi
cmdline=$(basename $0)
Expand Down Expand Up @@ -146,7 +146,7 @@ do
git_apply_opt="$git_apply_opt $1"; shift ;;

--resolvemsg=*)
resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
resolvemsg=${1#--resolvemsg=}; shift ;;

--)
shift; break ;;
Expand Down
6 changes: 3 additions & 3 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ f,*)
then
echo "Wonderful."
result_commit=$(
echo "$merge_msg" |
printf '%s\n' "$merge_msg" |
git-commit-tree $result_tree -p HEAD -p "$1"
) || exit
finish "$result_commit" "In-index merge"
Expand Down Expand Up @@ -433,7 +433,7 @@ done
if test '' != "$result_tree"
then
parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit
finish "$result_commit" "Merge made by $wt_strategy."
dropsave
exit 0
Expand Down Expand Up @@ -472,7 +472,7 @@ else
do
echo $remote
done >"$GIT_DIR/MERGE_HEAD"
echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG"
fi

if test "$merge_was_ok" = t
Expand Down
2 changes: 1 addition & 1 deletion git-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if [ "$annotate" ]; then
echo "#" ) > "$GIT_DIR"/TAG_EDITMSG
${VISUAL:-${EDITOR:-vi}} "$GIT_DIR"/TAG_EDITMSG || exit
else
echo "$message" >"$GIT_DIR"/TAG_EDITMSG
printf '%s\n' "$message" >"$GIT_DIR"/TAG_EDITMSG
fi

grep -v '^#' <"$GIT_DIR"/TAG_EDITMSG |
Expand Down

0 comments on commit a23bfae

Please sign in to comment.