summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:56 (GMT)
commit0de3a73eb6b36d5b8df82e62dd5679462f19edef (patch)
tree5a27d9b14c9768766c8ae81020a5904e0c6a6b36 /sequencer.c
parentbda53f4185b8f7d2197176fe83afcb8d5f47368b (diff)
parent982288e9bda8ea8587b8afef63eb3424b047a018 (diff)
downloadgit-0de3a73eb6b36d5b8df82e62dd5679462f19edef.zip
git-0de3a73eb6b36d5b8df82e62dd5679462f19edef.tar.gz
git-0de3a73eb6b36d5b8df82e62dd5679462f19edef.tar.bz2
Merge branch 'js/rebase-r-and-merge-head'
Bugfix for the recently graduated "git rebase --rebase-merges". * js/rebase-r-and-merge-head: status: rebase and merge can be in progress at the same time built-in rebase --skip/--abort: clean up stale .git/<name> files rebase -i: include MERGE_HEAD into files to clean up rebase -r: do not write MERGE_HEAD unless needed rebase -r: demonstrate bug with conflicting merges
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sequencer.c b/sequencer.c
index 0d87b07..e1a4dd1 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3244,10 +3244,6 @@ static int do_merge(struct commit *commit, const char *arg, int arg_len,
}
merge_commit = to_merge->item;
- write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ,
- git_path_merge_head(the_repository), 0);
- write_message("no-ff", 5, git_path_merge_mode(the_repository), 0);
-
bases = get_merge_bases(head_commit, merge_commit);
if (bases && oideq(&merge_commit->object.oid,
&bases->item->object.oid)) {
@@ -3256,6 +3252,10 @@ static int do_merge(struct commit *commit, const char *arg, int arg_len,
goto leave_merge;
}
+ write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ,
+ git_path_merge_head(the_repository), 0);
+ write_message("no-ff", 5, git_path_merge_mode(the_repository), 0);
+
for (j = bases; j; j = j->next)
commit_list_insert(j->item, &reversed);
free_commit_list(bases);
@@ -3512,6 +3512,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
unlink(rebase_path_author_script());
unlink(rebase_path_stopped_sha());
unlink(rebase_path_amend());
+ unlink(git_path_merge_head(the_repository));
delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
if (item->command == TODO_BREAK)
@@ -3882,6 +3883,7 @@ static int commit_staged_changes(struct replay_opts *opts,
opts, flags))
return error(_("could not commit staged changes."));
unlink(rebase_path_amend());
+ unlink(git_path_merge_head(the_repository));
if (final_fixup) {
unlink(rebase_path_fixup_msg());
unlink(rebase_path_squash_msg());