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>
Johannes Schindelin committed
Jan 2, 2017 at 16:27 UTC
5263220967209c7a64c065054fb64036815ac2ee
1 file changed
+6
-1
sequencer.c
+6
-1
@@ -1832,8 +1832,13 @@ static int commit_staged_changes(struct replay_opts *opts)
1832
1833
if (has_unstaged_changes(1))
1834
return error(_("cannot rebase: You have unstaged changes."));
1835
- if (!has_uncommitted_changes(0))
1835
+ if (!has_uncommitted_changes(0)) {
1836
+ const char *cherry_pick_head = git_path("CHERRY_PICK_HEAD");
1837
+
1838
+ if (file_exists(cherry_pick_head) && unlink(cherry_pick_head))
1839
+ return error(_("could not remove CHERRY_PICK_HEAD"));
1840
return 0;
1841
+ }
1842
1843
if (file_exists(rebase_path_amend())) {
1844
struct strbuf rev = STRBUF_INIT;