Skip to content

Commit 3dd0ebd

Browse files
committed
sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent c8fe4f2 commit 3dd0ebd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sequencer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,8 +1812,13 @@ static int commit_staged_changes(struct replay_opts *opts)
18121812

18131813
if (has_unstaged_changes(1))
18141814
return error(_("Cannot rebase: You have unstaged changes."));
1815-
if (!has_uncommitted_changes(0))
1815+
if (!has_uncommitted_changes(0)) {
1816+
const char *cherry_pick_head = git_path("CHERRY_PICK_HEAD");
1817+
1818+
if (file_exists(cherry_pick_head) && unlink(cherry_pick_head))
1819+
return error("Could not remove CHERRY_PICK_HEAD");
18161820
return 0;
1821+
}
18171822

18181823
if (file_exists(git_path_rebase_amend())) {
18191824
struct strbuf rev = STRBUF_INIT;

0 commit comments

Comments
 (0)