fix cherry-pick/revert status after commit

If the user commits a conflict resolution using `git commit` in the
middle of a sequence of cherry-picks/reverts then `git status` missed
the fact that a cherry-pick/revert is still in progress.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Phillip Wood
2019-04-16 11:18:42 +01:00
committed by Junio C Hamano
parent b07d9bfd17
commit 4a72486de9
4 changed files with 107 additions and 5 deletions

View File

@ -780,6 +780,24 @@ EOF
test_i18ncmp expected actual
'
test_expect_success 'status when cherry-picking after committing conflict resolution' '
git reset --hard cherry_branch &&
test_when_finished "git cherry-pick --abort" &&
test_must_fail git cherry-pick cherry_branch_second one_cherry &&
echo end >main.txt &&
git commit -a &&
cat >expected <<EOF &&
On branch cherry_branch
Cherry-pick currently in progress.
(run "git cherry-pick --continue" to continue)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
'
test_expect_success 'status showing detached at and from a tag' '
test_commit atag tagging &&
git checkout atag &&
@ -857,6 +875,24 @@ EOF
test_i18ncmp expected actual
'
test_expect_success 'status while reverting after committing conflict resolution' '
test_when_finished "git revert --abort" &&
git reset --hard new &&
test_must_fail git revert old new &&
echo reverted >to-revert.txt &&
git commit -a &&
cat >expected <<EOF &&
On branch master
Revert currently in progress.
(run "git revert --continue" to continue)
(use "git revert --abort" to cancel the revert operation)
nothing to commit (use -u to show untracked files)
EOF
git status --untracked-files=no >actual &&
test_i18ncmp expected actual
'
test_expect_success 'prepare for different number of commits rebased' '
git reset --hard master &&
git checkout -b several_commits &&