Skip to content

Commit 9dd29db

Browse files
newrengitster
authored andcommitted
diffcore-rename: treat a rename_limit of 0 as unlimited
In commit 8997355 (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 9f7e4bf (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6623a52 commit 9dd29db

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Documentation/diff-options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ of a delete/create pair.
598598
prevents the exhaustive portion of rename/copy detection from
599599
running if the number of source/destination files involved
600600
exceeds the specified number. Defaults to diff.renameLimit.
601+
Note that a value of 0 is treated as unlimited.
601602

602603
ifndef::git-format-patch[]
603604
--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::

diffcore-rename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ static int too_many_rename_candidates(int num_destinations, int num_sources,
10211021
* memory for the matrix anyway.
10221022
*/
10231023
if (rename_limit <= 0)
1024-
rename_limit = 32767;
1024+
return 0; /* treat as unlimited */
10251025
if (st_mult(num_destinations, num_sources)
10261026
<= st_mult(rename_limit, rename_limit))
10271027
return 0;

0 commit comments

Comments
 (0)