path: root/diffcore-rename.c
diff options
authorJeff King <>2011-02-19 10:20:51 (GMT)
committerJunio C Hamano <>2011-02-21 18:21:26 (GMT)
commitbf0ab10fa84df6c49450a06077d1c52756d88222 (patch)
tree0722540155c202e474b59de2fa41db1e740a4bbd /diffcore-rename.c
parent7ed863a85a6ce2c4ac4476848310b8f917ab41f9 (diff)
merge: improve inexact rename limit warning
The warning is generated deep in the diffcore code, which means that it will come first, followed possibly by a spew of conflicts, making it hard to see. Instead, let's have diffcore pass back the information about how big the rename limit would needed to have been, and then the caller can provide a more appropriate message (and at a more appropriate time). No refactoring of other non-merge callers is necessary, because nobody else was even using the warn_on_rename_limit feature. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'diffcore-rename.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index df41be5..1943c46 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -493,12 +493,13 @@ void diffcore_rename(struct diff_options *options)
* but handles the potential overflow case specially (and we
* assume at least 32-bit integers)
+ options->needed_rename_limit = 0;
if (rename_limit <= 0 || rename_limit > 32767)
rename_limit = 32767;
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 (created: %d deleted: %d), skipping inexact rename detection", num_create, num_src);
+ options->needed_rename_limit =
+ num_src > num_create ? num_src : num_create;
goto cleanup;