summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-02 15:27:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 22:57:29 (GMT)
commit5263220967209c7a64c065054fb64036815ac2ee (patch)
treef1b67d039fa5e1198e43b6fe371bf7b6debef854 /sequencer.c
parent9d93ccd1d2d2d40a3c7ecc76740caf28683144ac (diff)
downloadgit-5263220967209c7a64c065054fb64036815ac2ee.zip
git-5263220967209c7a64c065054fb64036815ac2ee.tar.gz
git-5263220967209c7a64c065054fb64036815ac2ee.tar.bz2
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index 69301fe..52e17c8 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1832,8 +1832,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;