summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-29 07:42:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-29 07:42:57 (GMT)
commit9530eb1db874a6eb1278aa904406d379c601856e (patch)
tree9533ea0ad0cc7a0d5c3cdf1ed8b4f0d4d80d8609
parent0630a66f8a043018604c5eb48e2c6881bd6c95e5 (diff)
parent885c716f0f039cfe100f5d761e1011085b43fbb8 (diff)
downloadgit-9530eb1db874a6eb1278aa904406d379c601856e.zip
git-9530eb1db874a6eb1278aa904406d379c601856e.tar.gz
git-9530eb1db874a6eb1278aa904406d379c601856e.tar.bz2
Merge branch 'bs/maint-rename-populate-filespec' into maint
* bs/maint-rename-populate-filespec: Rename detection: Avoid repeated filespec population
-rw-r--r--diffcore-rename.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 168a95b..0b0d6b8 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -153,9 +153,9 @@ static int estimate_similarity(struct diff_filespec *src,
* is a possible size - we really should have a flag to
* say whether the size is valid or not!)
*/
- if (!src->cnt_data && diff_populate_filespec(src, 0))
+ if (!src->cnt_data && diff_populate_filespec(src, 1))
return 0;
- if (!dst->cnt_data && diff_populate_filespec(dst, 0))
+ if (!dst->cnt_data && diff_populate_filespec(dst, 1))
return 0;
max_size = ((src->size > dst->size) ? src->size : dst->size);
@@ -173,6 +173,11 @@ static int estimate_similarity(struct diff_filespec *src,
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
return 0;
+ if (!src->cnt_data && diff_populate_filespec(src, 0))
+ return 0;
+ if (!dst->cnt_data && diff_populate_filespec(dst, 0))
+ return 0;
+
delta_limit = (unsigned long)
(base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);
if (diffcore_count_changes(src, dst,