Skip to content

Commit b3c32ea

Browse files
bebarinogitster
authored andcommitted
t4150: test applying with a newline in subject
Commit 4b7cc26 (git-am: use printf instead of echo on user-supplied strings, 2007-05-25) fixed a bug where subjects with newlines would cause git-am to echo multiple lines when it says "Applying: <subject>". This test ensures that fix stays valid. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4f4fa9c commit b3c32ea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

t/t4150-am.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,12 @@ test_expect_success 'am into an unborn branch' '
305305
test "z$result" = "z$(git rev-parse first^{tree})"
306306
'
307307

308+
test_expect_success 'am newline in subject' '
309+
git checkout first &&
310+
test_tick &&
311+
sed -e "s/second/second \\\n foo/" patch1 > patchnl &&
312+
git am < patchnl > output.out 2>&1 &&
313+
grep "^Applying: second \\\n foo$" output.out
314+
'
315+
308316
test_done

0 commit comments

Comments
 (0)