Skip to content

Commit

Permalink
t4150: test applying with a newline in subject
Browse files Browse the repository at this point in the history
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 <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stephen Boyd authored and Junio C Hamano committed Jun 18, 2009
1 parent 4f4fa9c commit b3c32ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/t4150-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,12 @@ test_expect_success 'am into an unborn branch' '
test "z$result" = "z$(git rev-parse first^{tree})"
'

test_expect_success 'am newline in subject' '
git checkout first &&
test_tick &&
sed -e "s/second/second \\\n foo/" patch1 > patchnl &&
git am < patchnl > output.out 2>&1 &&
grep "^Applying: second \\\n foo$" output.out
'

test_done

0 comments on commit b3c32ea

Please sign in to comment.