t3404: demonstrate CHERRY_PICK_HEAD bug
When rev-list's --cherry option does not detect that a patch has already been applied upstream, an interactive rebase would offer to reapply it and consequently stop at that patch with a failure, mentioning that the diff is empty. Traditionally, a `git rebase --continue` simply skips the commit in such a situation. However, as pointed out by Gábor Szeder, this leaves a CHERRY_PICK_HEAD behind, making the Git prompt believe that a cherry pick is still going on. This commit adds a test case demonstrating this bug. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jun 18, 2015 at 18:38 UTC
d17ec3a9daffd7f525f39b52011dc653afcbd275
1 file changed
+21
t/t3404-rebase-interactive.sh
+21
@@ -1039,4 +1039,25 @@ test_expect_success 'short SHA-1 collide' '
1039
)
1040
'
1041
1042
+test_expect_failure 'rebase --continue removes CHERRY_PICK_HEAD' '
1043
+ git checkout -b commit-to-skip &&
1044
+ for double in X 3 1
1045
+ do
1046
+ test_seq 5 | sed "s/$double/&&/" >seq &&
1047
+ git add seq &&
1048
+ test_tick &&
1049
+ git commit -m seq-$double
1050
+ done &&
1051
+ git tag seq-onto &&
1052
+ git reset --hard HEAD~2 &&
1053
+ git cherry-pick seq-onto &&
1054
+ set_fake_editor &&
1055
+ test_must_fail env FAKE_LINES= git rebase -i seq-onto &&
1056
+ test -d .git/rebase-merge &&
1057
+ git rebase --continue &&
1058
+ git diff --exit-code seq-onto &&
1059
+ test ! -d .git/rebase-merge &&
1060
+ test ! -f .git/CHERRY_PICK_HEAD
1061
+'
1062
+
1063
test_done