summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-02-18 20:12:06 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-18 22:26:45 -0800
commit3a4d67692b5a80213ca47a603fa5505a5990cc87 (patch)
tree9cc39e3ae9cc0f925040920d8e004a9faf82f3a5 /diffcore-rename.c
parent0940e5f211452ec2520d1b04233acddf0a872c06 (diff)
downloadgit-3a4d67692b5a80213ca47a603fa5505a5990cc87.tar.gz
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>
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index b9b039d4a3..0cd4c1305b 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))