From b07d9bfd171d881a02d110b68673c58cb63e9f62 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Tue, 16 Apr 2019 11:18:41 +0100 Subject: commit/reset: try to clean up sequencer state When cherry-picking or reverting a sequence of commits and if the final pick/revert has conflicts and the user uses `git commit` to commit the conflict resolution and does not run `git cherry-pick --continue` then the sequencer state is left behind. This can cause problems later. In my case I cherry-picked a sequence of commits the last one of which I committed with `git commit` after resolving some conflicts, then a while later, on a different branch I aborted a revert which rewound my HEAD to the end of the cherry-pick sequence on the previous branch. Avoid this potential problem by removing the sequencer state if we're committing or resetting the final pick in a sequence. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- builtin/commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin') diff --git a/builtin/commit.c b/builtin/commit.c index 2986553d5f..9df3414d80 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1657,8 +1657,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) die("%s", err.buf); } - unlink(git_path_cherry_pick_head(the_repository)); - unlink(git_path_revert_head(the_repository)); + sequencer_post_commit_cleanup(the_repository); unlink(git_path_merge_head(the_repository)); unlink(git_path_merge_msg(the_repository)); unlink(git_path_merge_mode(the_repository)); -- cgit v1.2.3