]> git.ipfire.org Git - thirdparty/git.git/commit
rebase -r: do not write MERGE_HEAD unless needed
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 12 Nov 2018 23:25:58 +0000 (15:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Nov 2018 03:04:00 +0000 (12:04 +0900)
commit85f8d9da2182690461e05034a4a697f766bb8eb1
tree22fa8db06b0a2edab4274d12c6ab73b4395018af
parentf08110ddd84438f4a8d69c145fae7f65fc91940f
rebase -r: do not write MERGE_HEAD unless needed

When we detect that a `merge` can be skipped because the merged commit
is already an ancestor of HEAD, we do not need to commit, therefore
writing the MERGE_HEAD file is useless.

It is actually worse than useless: a subsequent `git commit` will pick
it up and think that we want to merge that commit, still.

To avoid that, move the code that writes the MERGE_HEAD file to a
location where we already know that the `merge` cannot be skipped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3430-rebase-merges.sh