From: Linus Torvalds Date: Sat, 19 Feb 2011 04:12:06 +0000 (-0800) Subject: diffcore-rename: improve estimate_similarity() heuristics X-Git-Tag: v1.7.4.2~17^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a4d67692b5a80213ca47a603fa5505a5990cc87;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/diffcore-rename.c b/diffcore-rename.c index b9b039d4a..0cd4c1305 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -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))