diffcore-rename: treat a rename_limit of 0 as unlimited
In commit 89973554b52c (diffcore-rename: make diff-tree -l0 mean -l<large>, 2017-11-29), -l0 was given a special magical "large" value, but one which was not large enough for some uses (as can be seen from commit 9f7e4bfa3b6d (diff: remove silent clamp of renameLimit, 2017-11-13). Make 0 (or a negative value) be treated as unlimited instead and update the documentation to mention this. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Jul 15, 2021 at 00:45 UTC
9dd29dbef01e39fe9df81ad9e5e193128d8c5ad5
2 files changed
+2
-1
Documentation/diff-options.txt
+1
@@ -598,6 +598,7 @@ of a delete/create pair.
598
prevents the exhaustive portion of rename/copy detection from
599
running if the number of source/destination files involved
600
exceeds the specified number. Defaults to diff.renameLimit.
601
+ Note that a value of 0 is treated as unlimited.
602
603
ifndef::git-format-patch[]
604
--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
diffcore-rename.c
+1
-1
@@ -1021,7 +1021,7 @@ static int too_many_rename_candidates(int num_destinations, int num_sources,
1021
* memory for the matrix anyway.
1022
*/
1023
if (rename_limit <= 0)
1024
- rename_limit = 32767;
1024
+ return 0; /* treat as unlimited */
1025
if (st_mult(num_destinations, num_sources)
1026
<= st_mult(rename_limit, rename_limit))
1027
return 0;