@matheusbsbs / matheus-bagliano / commits / ee542ee3fc
Fork 0

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>

Jeff King committed Mar 1, 2008 at 01:14 UTC ee542ee3fc309fa95622b274c09eefbe394cd108
1 file changed +4 -3
diffcore-rename.c
+4 -3
@@ -468,10 +468,11 @@ void diffcore_rename(struct diff_options *options)
468 */
469 if (rename_limit <= 0 || rename_limit > 32767)
470 rename_limit = 32767;
471 - if (num_create > rename_limit && num_src > rename_limit)
472 - goto cleanup;
473 - if (num_create * num_src > rename_limit * rename_limit)
471 + if ((num_create > rename_limit && num_src > rename_limit) ||
472 + (num_create * num_src > rename_limit * rename_limit)) {
473 + warning("too many files, skipping inexact rename detection");
474 goto cleanup;
475 + }
476
477 mx = xmalloc(sizeof(*mx) * num_create * num_src);
478 for (dst_cnt = i = 0; i < rename_dst_nr; i++) {