git-prompt: improve cherry-pick/revert detection
If the user commits or resets a conflict resolution in the middle of a sequence of cherry-picks or reverts then CHERRY_PICK_HEAD/REVERT_HEAD will be removed and so in the absence of those files we need to check .git/sequencer/todo to see if there is a cherry-pick or revert 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:

committed by
Junio C Hamano

parent
8dca754b1e
commit
e981bf7525
@ -211,8 +211,24 @@ test_expect_success 'prompt - merge' '
|
||||
|
||||
test_expect_success 'prompt - cherry-pick' '
|
||||
printf " (master|CHERRY-PICKING)" >expected &&
|
||||
test_must_fail git cherry-pick b1 &&
|
||||
test_when_finished "git reset --hard" &&
|
||||
test_must_fail git cherry-pick b1 b1^ &&
|
||||
test_when_finished "git cherry-pick --abort" &&
|
||||
__git_ps1 >"$actual" &&
|
||||
test_cmp expected "$actual" &&
|
||||
git reset --merge &&
|
||||
test_must_fail git rev-parse CHERRY_PICK_HEAD &&
|
||||
__git_ps1 >"$actual" &&
|
||||
test_cmp expected "$actual"
|
||||
'
|
||||
|
||||
test_expect_success 'prompt - revert' '
|
||||
printf " (master|REVERTING)" >expected &&
|
||||
test_must_fail git revert b1^ b1 &&
|
||||
test_when_finished "git revert --abort" &&
|
||||
__git_ps1 >"$actual" &&
|
||||
test_cmp expected "$actual" &&
|
||||
git reset --merge &&
|
||||
test_must_fail git rev-parse REVERT_HEAD &&
|
||||
__git_ps1 >"$actual" &&
|
||||
test_cmp expected "$actual"
|
||||
'
|
||||
|
Reference in New Issue
Block a user