Skip to content

Commit ee542ee

Browse files
peffgitster
authored andcommitted
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>
1 parent 3ebfe63 commit ee542ee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

diffcore-rename.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,11 @@ void diffcore_rename(struct diff_options *options)
468468
*/
469469
if (rename_limit <= 0 || rename_limit > 32767)
470470
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");
474474
goto cleanup;
475+
}
475476

476477
mx = xmalloc(sizeof(*mx) * num_create * num_src);
477478
for (dst_cnt = i = 0; i < rename_dst_nr; i++) {

0 commit comments

Comments
 (0)