aboutsummaryrefslogtreecommitdiff
path: root/t/t3510-cherry-pick-sequence.sh
diff options
context:
space:
mode:
authorStephan Beyer <s-beyer@gmx.net>2016-12-07 22:51:32 +0100
committerJunio C Hamano <gitster@pobox.com>2016-12-09 14:50:45 -0800
commit1e41229d962b43208e6bf79e729b400c31697cc9 (patch)
tree4c9a5b2eb4277ca20791331e60bdfd65a78134a6 /t/t3510-cherry-pick-sequence.sh
parentaeebd98ebe0fbd61f517d9da04f914c37ea0066b (diff)
downloadgit-1e41229d962b43208e6bf79e729b400c31697cc9.tar.gz
git-1e41229d962b43208e6bf79e729b400c31697cc9.tar.xz
sequencer: make sequencer abort safer
In contrast to "git am --abort", a sequencer abort did not check whether the current HEAD is the one that is expected. This can lead to loss of work (when not spotted and resolved using reflog before the garbage collector chimes in). This behavior is now changed by mimicking "git am --abort". The abortion is done but HEAD is not changed when the current HEAD is not the expected HEAD. A new file "sequencer/abort-safety" is added to save the expected HEAD. The new behavior is only active when --abort is invoked on multiple picks. The problem does not occur for the single-pick case because it is handled differently. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3510-cherry-pick-sequence.sh')
-rwxr-xr-xt/t3510-cherry-pick-sequence.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index efcd4fc48..372307c21 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -147,7 +147,7 @@ test_expect_success '--abort to cancel single cherry-pick' '
git diff-index --exit-code HEAD
'
-test_expect_failure '--abort does not unsafely change HEAD' '
+test_expect_success '--abort does not unsafely change HEAD' '
pristine_detach initial &&
test_must_fail git cherry-pick picked anotherpick &&
git reset --hard base &&