summaryrefslogtreecommitdiff
path: root/t/t3507-cherry-pick-conflict.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-05-13 14:50:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-13 14:50:35 (GMT)
commitb51a0fdc3822c2ef260f6d496b6df6d33b101e8a (patch)
tree62b916b74af5ee6f51b6e924d9d7a65311085420 /t/t3507-cherry-pick-conflict.sh
parent7ba06bc3d026cee54437db5cfddfffe7b4d7a187 (diff)
parent4a72486de97b5c6b0979b2b51e50c268bdb0d4f6 (diff)
downloadgit-b51a0fdc3822c2ef260f6d496b6df6d33b101e8a.zip
git-b51a0fdc3822c2ef260f6d496b6df6d33b101e8a.tar.gz
git-b51a0fdc3822c2ef260f6d496b6df6d33b101e8a.tar.bz2
Merge branch 'pw/clean-sequencer-state-upon-final-commit'
"git chery-pick" (and "revert" that shares the same runtime engine) that deals with multiple commits got confused when the final step gets stopped with a conflict and the user concluded the sequence with "git commit". Attempt to fix it by cleaning up the state files used by these commands in such a situation. * pw/clean-sequencer-state-upon-final-commit: fix cherry-pick/revert status after commit commit/reset: try to clean up sequencer state
Diffstat (limited to 't/t3507-cherry-pick-conflict.sh')
-rwxr-xr-xt/t3507-cherry-pick-conflict.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh
index 1a8818f..9b9b4ca 100755
--- a/t/t3507-cherry-pick-conflict.sh
+++ b/t/t3507-cherry-pick-conflict.sh
@@ -161,6 +161,25 @@ test_expect_success 'successful commit clears CHERRY_PICK_HEAD' '
test_must_fail git rev-parse --verify CHERRY_PICK_HEAD
'
+test_expect_success 'successful final commit clears cherry-pick state' '
+ pristine_detach initial &&
+
+ test_must_fail git cherry-pick base picked-signed &&
+ echo resolved >foo &&
+ test_path_is_file .git/sequencer/todo &&
+ git commit -a &&
+ test_must_fail test_path_exists .git/sequencer
+'
+
+test_expect_success 'reset after final pick clears cherry-pick state' '
+ pristine_detach initial &&
+
+ test_must_fail git cherry-pick base picked-signed &&
+ echo resolved >foo &&
+ test_path_is_file .git/sequencer/todo &&
+ git reset &&
+ test_must_fail test_path_exists .git/sequencer
+'
test_expect_success 'failed cherry-pick produces dirty index' '
pristine_detach initial &&
@@ -361,6 +380,26 @@ test_expect_success 'failed commit does not clear REVERT_HEAD' '
test_cmp_rev picked REVERT_HEAD
'
+test_expect_success 'successful final commit clears revert state' '
+ pristine_detach picked-signed &&
+
+ test_must_fail git revert picked-signed base &&
+ echo resolved >foo &&
+ test_path_is_file .git/sequencer/todo &&
+ git commit -a &&
+ test_must_fail test_path_exists .git/sequencer
+'
+
+test_expect_success 'reset after final pick clears revert state' '
+ pristine_detach picked-signed &&
+
+ test_must_fail git revert picked-signed base &&
+ echo resolved >foo &&
+ test_path_is_file .git/sequencer/todo &&
+ git reset &&
+ test_must_fail test_path_exists .git/sequencer
+'
+
test_expect_success 'revert conflict, diff3 -m style' '
pristine_detach initial &&
git config merge.conflictstyle diff3 &&