]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diffcore-rename: treat a rename_limit of 0 as unlimited
authorElijah Newren <newren@gmail.com>
Thu, 15 Jul 2021 00:45:23 +0000 (00:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jul 2021 23:54:24 +0000 (16:54 -0700)
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>
Documentation/diff-options.txt
diffcore-rename.c

index 58acfff92893898f4656eaeeac04ae637c4971b2..0aebe83205783bdc5e21d982f9219b79c3fbecfc 100644 (file)
@@ -598,6 +598,7 @@ of a delete/create pair.
        prevents the exhaustive portion of rename/copy detection from
        running if the number of source/destination files involved
        exceeds the specified number.  Defaults to diff.renameLimit.
+       Note that a value of 0 is treated as unlimited.
 
 ifndef::git-format-patch[]
 --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
index 3375e24659ea1a34eca48af6109fa534861c8c7c..513ba7b05f1cccc7806a3e26283fde9b23c78229 100644 (file)
@@ -1021,7 +1021,7 @@ static int too_many_rename_candidates(int num_destinations, int num_sources,
         * memory for the matrix anyway.
         */
        if (rename_limit <= 0)
-               rename_limit = 32767;
+               return 0; /* treat as unlimited */
        if (st_mult(num_destinations, num_sources)
            <= st_mult(rename_limit, rename_limit))
                return 0;