checkout -m: attempt merge when deletion of path was staged
commit60960f899ba61a75c0c3f8e9e06eea86a233ce60
authorJonathan Nieder <jrnieder@gmail.com>
Wed, 13 Aug 2014 00:03:18 +0000 (12 17:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Aug 2014 17:32:16 +0000 (13 10:32 -0700)
tree67296f9442657ef5f19de54dfd07ecce73f4cc27
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 motivating case hasn't been tested.

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