• J
    merge: fix NULL pointer dereference when merging nothing into void · b84e65d4
    Junio C Hamano 提交于
    When we are on an unborn branch and merging only one foreign parent,
    we allow "git merge" to fast-forward to that foreign parent commit.
    
    This codepath incorrectly attempted to dereference the list of
    parents that the merge is going to record even when the list is
    empty.  It must refuse to operate instead when there is no parent.
    
    All other codepaths make sure the list is not empty before they
    dereference it, and are safe.
    
    Reported-by: Jose Ivan B. Vilarouca Filho
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    b84e65d4
t7600-merge.sh 17.7 KB