sequencer: clear state upon dropping a become-empty commit
authorElijah Newren <newren@gmail.com>
Wed, 11 Mar 2020 15:30:22 +0000 (15:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Mar 2020 19:11:05 +0000 (12:11 -0700)
commit9a1b7474d6babad5fabed9a2926a57d875f3820b
tree865d615e5582efc65b870e07eb91f3ead0d573b2
parent937d1436302582c4e769594a805978d03e89ad59
sequencer: clear state upon dropping a become-empty commit

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 and MERGE_MSG files, 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 such
state files when we decide to drop the commit.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3424-rebase-empty.sh