Skip to content

Commit

Permalink
t4150: am --resolved fails if index has unmerged entries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed Jul 20, 2015
1 parent 60ff7f9 commit 9e2a113
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t4150-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,19 @@ test_expect_success 'am --resolved fails if index has no changes' '
test_cmp_rev lorem2^^ HEAD
'

test_expect_success 'am --resolved fails if index has unmerged entries' '
rm -fr .git/rebase-apply &&
git reset --hard &&
git checkout second &&
test_must_fail git am -3 lorem-move.patch &&
test_path_is_dir .git/rebase-apply &&
test_cmp_rev second HEAD &&
test_must_fail git am --resolved >err &&
test_path_is_dir .git/rebase-apply &&
test_cmp_rev second HEAD &&
test_i18ngrep "still have unmerged paths" err
'

test_expect_success 'am takes patches from a Pine mailbox' '
rm -fr .git/rebase-apply &&
git reset --hard &&
Expand Down

0 comments on commit 9e2a113

Please sign in to comment.