diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-18 20:12:06 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-18 22:26:45 -0800 |
commit | 3a4d67692b5a80213ca47a603fa5505a5990cc87 (patch) | |
tree | 9cc39e3ae9cc0f925040920d8e004a9faf82f3a5 | |
parent | 0940e5f211452ec2520d1b04233acddf0a872c06 (diff) | |
download | git-3a4d67692b5a80213ca47a603fa5505a5990cc87.tar.gz git-3a4d67692b5a80213ca47a603fa5505a5990cc87.tar.xz |
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>
-rw-r--r-- | diffcore-rename.c | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |