Skip to content
  • Junio C Hamano's avatar
    rerere: do not leak mmfile[] for a path with multiple stage #1 entries · 7d4053b6
    Junio C Hamano authored
    
    
    A conflicted index can have multiple stage #1 entries when dealing
    with a criss-cross merge and using the "resolve" merge strategy.
    
    Plug the leak by reading only the first one of the same stage
    entries.
    
    Strictly speaking, this fix does change the semantics, in that we
    used to use the last stage #1 entry as the common ancestor when
    doing the plain-vanilla three-way merge, but with the leak fix, we
    will use the first stage #1 entry.  But it is not a grave backward
    compatibility breakage.  Either way, we are arbitrarily picking one
    of multiple stage #1 entries and using it, ignoring others, and
    there is no meaning in the ordering of these stage #1 entries.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    7d4053b6