@matheusbsbs / matheus-bagliano / commits / 3a4d67692b
Fork 0

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>

Linus Torvalds committed Feb 18, 2011 at 20:12 UTC 3a4d67692b5a80213ca47a603fa5505a5990cc87
1 file changed +1 -1
diffcore-rename.c
+1 -1
@@ -170,7 +170,7 @@ static int estimate_similarity(struct diff_filespec *src,
170 * and the final score computation below would not have a
171 * divide-by-zero issue.
172 */
173 - if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
173 + if (max_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
174 return 0;
175
176 if (!src->cnt_data && diff_populate_filespec(src, 0))