revert: Remove sequencer state when no commits are pending
[gitweb.git] / t / t3510-cherry-pick-sequence.sh
index fd6986541a71b4ea133333e2fd1f43cc2bd85997..a4140865788cd4da0c81626416af420d482fe670 100755 (executable)
@@ -82,4 +82,28 @@ test_expect_success '--reset cleans up sequencer state' '
        test_path_is_missing .git/sequencer
 '
 
+test_expect_success 'cherry-pick cleans up sequencer state when one commit is left' '
+       pristine_detach initial &&
+       test_must_fail git cherry-pick base..picked &&
+       test_path_is_missing .git/sequencer &&
+       echo "resolved" >foo &&
+       git add foo &&
+       git commit &&
+       {
+               git rev-list HEAD |
+               git diff-tree --root --stdin |
+               sed "s/$_x40/OBJID/g"
+       } >actual &&
+       cat >expect <<-\EOF &&
+       OBJID
+       :100644 100644 OBJID OBJID M    foo
+       OBJID
+       :100644 100644 OBJID OBJID M    unrelated
+       OBJID
+       :000000 100644 OBJID OBJID A    foo
+       :000000 100644 OBJID OBJID A    unrelated
+       EOF
+       test_cmp expect actual
+'
+
 test_done