Re: [PATCH 7/9] ls-refs: ignore very long ref-prefix counts
From: Jeff King <hidden>
Date: 2021-09-14 22:15:42
On Tue, Sep 14, 2021 at 06:11:32PM -0400, Taylor Blau wrote:
On Tue, Sep 14, 2021 at 06:09:45PM -0400, Jeff King wrote:quoted
On Tue, Sep 14, 2021 at 11:37:06AM -0400, Jeff King wrote:quoted
+test_expect_success 'ignore very large set of prefixes' ' + # generate a large number of ref-prefixes that we expect + # to match nothing; the value here exceeds MAX_ALLOWED_PREFIXES + # from ls-refs.c. + { + echo command=ls-refs && + echo object-format=$(test_oid algo) + echo 0001 && + perl -le "print \"refs/heads/$_\" for (1..65536+1)" && + echo 0000 + } | + test-tool pkt-line pack >in &&Yuck. While double-checking some refactoring, I realized this test does not actually generate the correct input! It omits the "ref-prefix" header. _And_ it accidentally expands $_ in the shell rather than in perl.Hah, nice find. You'd think that one of us would have caught it earlier given that we both discussed it.
Really, I'd have thought that ls-refs would complain about a totally bogus capability. I'll see if I can fix that, as well. -Peff