diff options
-rw-r--r-- | builtin/revert.c | 12 | ||||
-rwxr-xr-x | t/t3510-cherry-pick-sequence.sh | 6 |
2 files changed, 4 insertions, 14 deletions
diff --git a/builtin/revert.c b/builtin/revert.c index 5785ff9941..5dcfa6ba69 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -1018,18 +1018,8 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts) for (cur = todo_list; cur; cur = cur->next) { save_todo(cur, opts); res = do_pick_commit(cur->item, opts); - if (res) { - if (!cur->next) - /* - * An error was encountered while - * picking the last commit; the - * sequencer state is useless now -- - * the user simply needs to resolve - * the conflict and commit - */ - remove_sequencer_state(0); + if (res) return res; - } } /* diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 98a27a23ea..851b147f81 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@ -203,10 +203,10 @@ test_expect_success '--abort refuses to clobber unrelated change, harder case' ' test_cmp_rev initial HEAD ' -test_expect_success 'cherry-pick cleans up sequencer state when one commit is left' ' +test_expect_success 'cherry-pick still writes sequencer state when one commit is left' ' pristine_detach initial && test_must_fail git cherry-pick base..picked && - test_path_is_missing .git/sequencer && + test_path_is_dir .git/sequencer && echo "resolved" >foo && git add foo && git commit && @@ -227,7 +227,7 @@ test_expect_success 'cherry-pick cleans up sequencer state when one commit is le test_cmp expect actual ' -test_expect_failure '--abort after last commit in sequence' ' +test_expect_success '--abort after last commit in sequence' ' pristine_detach initial && test_must_fail git cherry-pick base..picked && git cherry-pick --abort && |