summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-22 01:31:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-22 09:38:26 -0700
commitcd1870edb6658d8118ed6015651a0ff080ae7162 (patch)
treee178bf923dc0395e4723262d0b210ec8573ce1bd /diffcore-rename.c
parent81e50eabf06dd68e8e62a9b697eaf60904c58b22 (diff)
downloadgit-cd1870edb6658d8118ed6015651a0ff080ae7162.tar.gz
[PATCH] Fix tweak in similarity estimator.
There was a screwy math bug in the estimator that confused what -C1 meant and what -C9 meant, only in one of the early "cheap" check, which resulted in quite confusing behaviour. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 28b1de25de..ff5c182df8 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -77,12 +77,12 @@ static int estimate_similarity(struct diff_filespec *src,
/* We would not consider edits that change the file size so
* drastically. delta_size must be smaller than
- * minimum_score/MAX_SCORE * min(src->size, dst->size).
+ * (MAX_SCORE-minimum_score)/MAX_SCORE * min(src->size, dst->size).
* Note that base_size == 0 case is handled here already
* and the final score computation below would not have a
* divide-by-zero issue.
*/
- if (base_size * minimum_score < delta_size * MAX_SCORE)
+ if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
return 0;
delta = diff_delta(src->data, src->size,