checkout -m: attempt merge when deletion of path was staged
commit6a143aa2b23b97fa8363e2f4fd16f23b4c5b104d
authorJonathan Nieder <jrnieder@gmail.com>
Wed, 13 Aug 2014 00:03:18 +0000 (12 17:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Aug 2014 22:17:34 +0000 (25 15:17 -0700)
tree6b8755ddc6c9210f39a5f477c41d859e9114d3c5
parent6c1db1b38886f70165cb9f5822b1a2e99a2c331b
checkout -m: attempt merge when deletion of path was staged

twoway_merge() is missing an o->gently check in the case where a file
that needs to be modified is missing from the index but present in the
old and new trees.  As a result, in this case 'git checkout -m' errors
out instead of trying to perform a merge.

Fix it by checking o->gently.  While at it, inline the o->gently check
into reject_merge to prevent future call sites from making the same
mistake.

Noticed by code inspection.  The test for the motivating case was
added by JC.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7201-co.sh
unpack-trees.c