From: Elijah Newren via GitGitGadget Date: Wed, 11 Mar 2020 05:13:40 GMT Subject: [PATCH 1/2] sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commit Message-ID: <132f769adb0a34e74b6c237ff84bf8b624ea0d9f.1583903621.git.gitgitgadget@gmail.com> In-Reply-To: From: Elijah Newren In commit e98c4269c8 ("rebase (interactive-backend): fix handling of commits that become empty", 2020-02-15), the merge backend was changed to drop commits that did not start empty but became so after being applied (because their changes were a subset of what was already upstream). This new code path did not need to go through the process of creating a commit, since we were dropping the commit instead. Unfortunately, this also means we bypassed the clearing of the CHERRY_PICK_HEAD file, which if there were no further commits to cherry-pick would mean that the rebase would end but assume there was still an operation in progress. Ensure that we clear CHERRY_PICK_HEAD when we decide to drop the commit. Signed-off-by: Elijah Newren --- sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index 7477b15422a..8b4e0200c5f 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1957,6 +1957,7 @@ static int do_pick_commit(struct repository *r, flags |= ALLOW_EMPTY; } else if (allow == 2) { drop_commit = 1; + unlink(git_path_cherry_pick_head(r)); fprintf(stderr, _("dropping %s %s -- patch contents already upstream\n"), oid_to_hex(&commit->object.oid), msg.subject); -- gitgitgadget