Browse Source

diffcore-rename: improve estimate_similarity() heuristics

The logic to quickly dismiss potential rename pairs was broken.  It
would too eagerly dismiss possible renames when all of the difference
was due to pure new data (or deleted data).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Linus Torvalds 14 years ago committed by Junio C Hamano
parent
commit
3a4d67692b
  1. 2
      diffcore-rename.c

2
diffcore-rename.c

@ -170,7 +170,7 @@ static int estimate_similarity(struct diff_filespec *src, @@ -170,7 +170,7 @@ static int estimate_similarity(struct diff_filespec *src,
* and the final score computation below would not have a
* divide-by-zero issue.
*/
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
if (max_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
return 0;

if (!src->cnt_data && diff_populate_filespec(src, 0))

Loading…
Cancel
Save