Skip to content
  • Junio C Hamano's avatar
    [PATCH] diffcore-break.c: various fixes. · f78c79c5
    Junio C Hamano authored
    
    
    This fixes three bugs in the -B heuristics.
    
     - Although it was advertised that the initial break criteria
       used was the same as what diffcore-rename uses, it was using
       something different.  Instead of using smaller of src and dst
       size to compare with "edit" size, (insertion and deletion),
       it was using larger of src and dst, unlike the rename/copy
       detection logic.  This caused the parameter to -B to mean
       something different from the one to -M and -C.  To compensate
       for this change, the default break score is also changed to
       match that of the default for rename/copy.
    
     - The code would have crashed with division by zero when trying
       to break an originally empty file.
    
     - Contrary to what the comment said, the algorithm was breaking
       small files, only to later merge them together.
    
    Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f78c79c5