X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diffcore-rename.c;h=0b0d6b8c8c2ab8833bb5d929ef0d3cb7891ec582;hb=26be15f09db15d2b53a13d0f184d77fb54367f33;hp=1b2ebb40014d820fe4fb679509ab694d453be7b4;hpb=b71ce7f3f13ebd0e212bdda82b012ee36df4f63f;p=git.git diff --git a/diffcore-rename.c b/diffcore-rename.c index 1b2ebb400..0b0d6b8c8 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, @@ -493,7 +498,7 @@ void diffcore_rename(struct diff_options *options) if ((num_create > rename_limit && num_src > rename_limit) || (num_create * num_src > rename_limit * rename_limit)) { if (options->warn_on_too_large_rename) - warning("too many files, skipping inexact rename detection"); + warning("too many files (created: %d deleted: %d), skipping inexact rename detection", num_create, num_src); goto cleanup; }