Skip to content

Commit

Permalink
rename: warn user when we have turned off rename detection
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 1, 2008
1 parent 3ebfe63 commit ee542ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diffcore-rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit ee542ee

Please sign in to comment.