checkout -m: attempt merge when deletion of path was staged
authorJonathan Nieder <redacted>
Wed, 13 Aug 2014 00:03:18 +0000 (17:03 -0700)
committerJunio C Hamano <redacted>
Mon, 25 Aug 2014 22:17:34 +0000 (15:17 -0700)
commit6a143aa2b23b97fa8363e2f4fd16f23b4c5b104d
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t7201-co.sh
unpack-trees.c
git clone https://git.99rst.org/PROJECT