Skip to content

Commit 9e2a113

Browse files
pyokagangitster
authored andcommitted
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>
1 parent 60ff7f9 commit 9e2a113

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

t/t4150-am.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,19 @@ test_expect_success 'am --resolved fails if index has no changes' '
437437
test_cmp_rev lorem2^^ HEAD
438438
'
439439

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+
440453
test_expect_success 'am takes patches from a Pine mailbox' '
441454
rm -fr .git/rebase-apply &&
442455
git reset --hard &&

0 commit comments

Comments
 (0)