From: Junio C Hamano Date: Sun, 27 Aug 2017 05:55:10 +0000 (-0700) Subject: Merge branch 'mg/killed-merge' X-Git-Tag: v2.15.0-rc0~114 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6e6ba65a7c8f8f9556ec42678f661794d47f7f98?ds=sidebyside Merge branch 'mg/killed-merge' Killing "git merge --edit" before the editor returns control left the repository in a state with MERGE_MSG but without MERGE_HEAD, which incorrectly tells the subsequent "git commit" that there was a squash merge in progress. This has been fixed. * mg/killed-merge: merge: save merge state earlier merge: split write_merge_state in two merge: clarify call chain Documentation/git-merge: explain --continue --- 6e6ba65a7c8f8f9556ec42678f661794d47f7f98 diff --cc builtin/merge.c index 7b7320dede,08a4083b6d..7df3fe3927 --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -764,10 -762,11 +765,13 @@@ static void prepare_to_commit(struct co struct strbuf msg = STRBUF_INIT; strbuf_addbuf(&msg, &merge_msg); strbuf_addch(&msg, '\n'); + if (squash) + BUG("the control must not reach here under --squash"); if (0 < option_edit) strbuf_commented_addf(&msg, _(merge_editor_comment), comment_line_char); + if (signoff) + append_signoff(&msg, ignore_non_trailer(msg.buf, msg.len), 0); + write_merge_heads(remoteheads); write_file_buf(git_path_merge_msg(), msg.buf, msg.len); if (run_commit_hook(0 < option_edit, get_index_file(), "prepare-commit-msg", git_path_merge_msg(), "merge", NULL))