test: "am -3" can accept non-standard -p<num>

This adds a test for the previous one to make sure that "am -3 -p0" can read patches created with the --no-prefix option. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 26, 2012 at 23:00 UTC a61ba26a4725d4a93297305315587b92324baf0b
1 file changed +15
t/t4150-am.sh
+15
@@ -123,6 +123,7 @@ test_expect_success setup '
123 git commit -m "added another file" &&
124
125 git format-patch --stdout master >lorem-move.patch &&
126 + git format-patch --no-prefix --stdout master >lorem-zero.patch &&
127
128 git checkout -b rename &&
129 git mv file renamed &&
@@ -276,6 +277,20 @@ test_expect_success 'am -3 falls back to 3-way merge' '
277 git diff --exit-code lorem
278 '
279
280 +test_expect_success 'am -3 -p0 can read --no-prefix patch' '
281 + rm -fr .git/rebase-apply &&
282 + git reset --hard &&
283 + git checkout -b lorem3 master2 &&
284 + sed -n -e "3,\$p" msg >file &&
285 + head -n 9 msg >>file &&
286 + git add file &&
287 + test_tick &&
288 + git commit -m "copied stuff" &&
289 + git am -3 -p0 lorem-zero.patch &&
290 + ! test -d .git/rebase-apply &&
291 + git diff --exit-code lorem
292 +'
293 +
294 test_expect_success 'am can rename a file' '
295 grep "^rename from" rename.patch &&
296 rm -fr .git/rebase-apply &&