sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed

The scripted version of the interactive rebase already does that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-04-09 16:29:21 +02:00
parent 2ab8a6b080
commit 74b4936fa2

View File

@@ -1879,8 +1879,13 @@ static int commit_staged_changes(struct replay_opts *opts)
if (has_unstaged_changes(1))
return error(_("cannot rebase: You have unstaged changes."));
if (!has_uncommitted_changes(0))
if (!has_uncommitted_changes(0)) {
const char *cherry_pick_head = git_path("CHERRY_PICK_HEAD");
if (file_exists(cherry_pick_head) && unlink(cherry_pick_head))
return error(_("could not remove CHERRY_PICK_HEAD"));
return 0;
}
if (file_exists(rebase_path_amend())) {
struct strbuf rev = STRBUF_INIT;