Skip to content

Commit 29df238

Browse files
committed
am: POSIX portability fix
POSIX allows echo without flag to interpret specials such as \n, and we tried to make things portable by using printf instead where it matters. Recently added code to "git am" had unprotected "echo", which was caught by t4014 and Rémi Vanicat. This should fix it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 11dc4e7 commit 29df238

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-am.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ do
302302
SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
303303
case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
304304

305-
(echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
305+
(printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") |
306306
git stripspace > "$dotest/msg-clean"
307307
;;
308308
esac

0 commit comments

Comments
 (0)