Skip to content
  • Junio C Hamano's avatar
    rerere: delay the recording of preimage · c0a5423b
    Junio C Hamano authored
    
    
    We record the preimage only when there is no directory to record the
    conflict we encountered, i.e. when $GIT_DIR/rr-cache/$ID does not
    exist.  As the plan is to allow multiple <preimage,postimage> pairs
    as variants for the same conflict ID eventually, this logic needs to
    go.
    
    As the first step in that direction, stop the "did we create the
    directory?  Then we record the preimage" logic.  Instead, we record
    if a preimage does not exist when we saw a conflict in a path.  Also
    make sure that we remove a stale postimage, which most likely is
    totally unrelated to the resolution of this new conflict, when we
    create a new preimage under $ID when $GIT_DIR/rr-cache/$ID already
    exists.
    
    In later patches, we will further update this logic to be "do we
    have <preimage,postimage> pair that cleanly resolve the current
    conflicts?  If not, record a new preimage as a new variant", but
    that does not happen at this stage yet.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    c0a5423b