merge: save merge state earlier
authorMichael J Gruber <git@grubix.eu>
Wed, 23 Aug 2017 12:10:45 +0000 (14:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Aug 2017 17:35:02 +0000 (10:35 -0700)
If the `git merge` process is killed while waiting for the editor to
finish, the merge state is lost but the prepared merge msg and tree is kept.
So, a subsequent `git commit` creates a squashed merge even when the
user asked for proper merge commit originally.

Demonstrate the problem with a test crafted after the in t7502. The test
requires EXECKEEPSPID (thus does not run under MINGW).

Save the merge state earlier (in the non-squash case) so that it does
not get lost. This makes the test pass.

Reported-by: hIpPy <hippy2981@gmail.com>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found