aboutsummaryrefslogtreecommitdiff
path: root/t/t3510-cherry-pick-sequence.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2011-08-04 16:09:14 +0530
committerJunio C Hamano <gitster@pobox.com>2011-08-08 09:24:51 -0700
commit21afd0806205d4a41c7c6076bd049842779ec080 (patch)
treedfb9ddee9eebf2abaa0e9c1cdb6fa4f4932f5302 /t/t3510-cherry-pick-sequence.sh
parent2d27daa91da1d6376916533de2ec4b50e6acc925 (diff)
downloadgit-21afd0806205d4a41c7c6076bd049842779ec080.tar.gz
git-21afd0806205d4a41c7c6076bd049842779ec080.tar.xz
revert: Don't implicitly stomp pending sequencer operation
Protect the user from forgetting about a pending sequencer operation by immediately erroring out when an existing cherry-pick or revert operation is in progress like: $ git cherry-pick foo ... conflict ... $ git cherry-pick moo error: .git/sequencer already exists hint: A cherry-pick or revert is in progress hint: Use --reset to forget about it fatal: cherry-pick failed A naive version of this would break the following established ways of working: $ git cherry-pick foo ... conflict ... $ git reset --hard # I actually meant "moo" when I said "foo" $ git cherry-pick moo $ git cherry-pick foo ... conflict ... $ git commit # commit the resolution $ git cherry-pick moo # New operation However, the previous patches "reset: Make reset remove the sequencer state" and "revert: Remove sequencer state when no commits are pending" make sure that this does not happen. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> 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.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index a41408657..566a15ed8 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -106,4 +106,13 @@ test_expect_success 'cherry-pick cleans up sequencer state when one commit is le
test_cmp expect actual
'
+test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '
+ pristine_detach initial &&
+ test_must_fail git cherry-pick base..anotherpick &&
+ test-chmtime -v +0 .git/sequencer >expect &&
+ test_must_fail git cherry-pick unrelatedpick &&
+ test-chmtime -v +0 .git/sequencer >actual &&
+ test_cmp expect actual
+'
+
test_done