git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] refs: fix loose-ref seeking across directory boundaries

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Oct 15, 2026, 19:04 UTC
Message-ID
<CALnO6CDH==atdV5tfHSiTuF6MFNebbjyVEzxBU09=xmU75LYQQ@mail.gmail.com>
In-Reply-To
<CAFuK-oaFyp7QdA=Nrc68cNx1iu803pQSUOZ=f947rRjWbJ7Z5w@mail.gmail.com>
[resending with corrected plain-text ':D]
Show 16 quoted lines
> On Thu, 15 Oct 2026 at 10:38 PM, D. Ben Knoble <ben.knoble@gmail.com> wrote:
>>
>> On Thu, Oct 15, 2026 at 10:20 AM Harald Nordgren
>> <haraldnordgren@gmail.com> wrote:
>> [snip]
>> > > +                     if test "$storage" = mixed
>> > > +                     then
>> > > +                             git pack-refs --all || return 1
>> > > +                     fi &&
>> >
>> > I don't see any reason why a test would need an if block, we know what data we
>> > expect, no?
>>
>> I didn't examine too closely, but this test is wrapped in a loop over
>> the storage variable that appears to determine whether and when we
>> pack-refs, so I think the conditional makes sense for that?
On Thu, Oct 15, 2026 at 1:13 PM Venkat Ragavan <mail2venkat21@gmail.com> wrote:
>
> Yes it does, I interpreted Harald’s suggestion was to write separate tests instead of looping over a variable outside the test block, either ways the logic of the test is going to remain the same.
[we bottom-post here]

I don’t mind the loop, personally; it might be worth looking around for other tests and see how they approach it.

You can also extract shared sections into functions if that makes writing separate tests easier.

-- 
D. Ben Knoble
Previous: Patrick SteinhardtNext: Venkat Ragavan
Message 10 of 11 in “refs: fix loose-ref seeking across directory boundaries”
  1. refs: fix loose-ref seeking across directory boundariesVenkat Ragavan via GitGitGadget, Oct 15, 2026
  2. Harald NordgrenOct 15, 2026
  3. D. Ben KnobleOct 15, 2026
  4. Junio C HamanoOct 15, 2026
  5. Harald NordgrenOct 15, 2026
  6. Junio C HamanoOct 27, 2026
  7. Patrick SteinhardtOct 28, 2026
  8. Junio C HamanoOct 28, 2026
  9. Patrick SteinhardtOct 28, 2026
  10. D. Ben KnobleOct 15, 2026
  11. Venkat RagavanOct 16, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.