summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-03-01 06:14:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-01 09:30:15 (GMT)
commitee542ee3fc309fa95622b274c09eefbe394cd108 (patch)
tree6d36528006a19dd6908cdb448a2fbd210f6cd32d
parent3ebfe63a82cdad55f4b4401f22be07f04cd438c2 (diff)
downloadgit-ee542ee3fc309fa95622b274c09eefbe394cd108.zip
git-ee542ee3fc309fa95622b274c09eefbe394cd108.tar.gz
git-ee542ee3fc309fa95622b274c09eefbe394cd108.tar.bz2
rename: warn user when we have turned off rename detection
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--diffcore-rename.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 3d37725..31941bc 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -468,10 +468,11 @@ void diffcore_rename(struct diff_options *options)
*/
if (rename_limit <= 0 || rename_limit > 32767)
rename_limit = 32767;
- if (num_create > rename_limit && num_src > rename_limit)
- goto cleanup;
- if (num_create * num_src > rename_limit * rename_limit)
+ if ((num_create > rename_limit && num_src > rename_limit) ||
+ (num_create * num_src > rename_limit * rename_limit)) {
+ warning("too many files, skipping inexact rename detection");
goto cleanup;
+ }
mx = xmalloc(sizeof(*mx) * num_create * num_src);
for (dst_cnt = i = 0; i < rename_dst_nr; i++) {