• Jonathan Nieder's avatar
    checkout -m: attempt merge when deletion of path was staged · 6a143aa2
    Jonathan Nieder authored
    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: default avatarJonathan Nieder <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
    6a143aa2
t7201-co.sh 15.5 KB