t4150: am --resolved fails if index has unmerged entries

Since c1d1128 (git-am --resolved: more usable error message., 2006-04-28), git-am --resolved will check to see if there are any unmerged entries, and will error out with a user-friendly error message if there are. Add a test for this. Reviewed-by: Stefan Beller <sbeller@google.com> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed Jul 19, 2015 at 23:49 UTC 9e2a113db95fb7e7eb3c74c1d0edc15be14fc0cf
1 file changed +13
t/t4150-am.sh
+13
@@ -437,6 +437,19 @@ test_expect_success 'am --resolved fails if index has no changes' '
437 test_cmp_rev lorem2^^ HEAD
438 '
439
440 +test_expect_success 'am --resolved fails if index has unmerged entries' '
441 + rm -fr .git/rebase-apply &&
442 + git reset --hard &&
443 + git checkout second &&
444 + test_must_fail git am -3 lorem-move.patch &&
445 + test_path_is_dir .git/rebase-apply &&
446 + test_cmp_rev second HEAD &&
447 + test_must_fail git am --resolved >err &&
448 + test_path_is_dir .git/rebase-apply &&
449 + test_cmp_rev second HEAD &&
450 + test_i18ngrep "still have unmerged paths" err
451 +'
452 +
453 test_expect_success 'am takes patches from a Pine mailbox' '
454 rm -fr .git/rebase-apply &&
455 git reset --hard &&