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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2026, 19:13 UTC
Message-ID
<xmqqse26n5fa.fsf@gitster.g>
In-Reply-To
<20261015133624.82112-1-haraldnordgren@gmail.com>
Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 9 quoted lines
> The general idea looks sound.
>
>> +			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?

This is three tests implemented as a single test with a for-loop around it. The variable instructs the single test_expect_success to behave slightly differently depending on its setting.

+for storage in loose packed mixed +do + test_expect_success "start after respects directory boundaries ($storage)" ' + test_when_finished "rm -rf repo" && + git init repo && + ( + cd repo && + test_commit --no-tag base && + git update-ref refs/tags/packed HEAD && + if test "$storage" = mixed + then + git pack-refs --all || return 1 + fi && + git update-ref --stdin <<-\EOF && + create refs/tags/a-leaf HEAD + ... + EOF + if test "$storage" = packed + then + git pack-refs --all || return 1 + fi && + ... real test in the repository begins ... + ) + ' +done

It creates a tag "packed", and packs when storage is "mixed". Then we create many other refs, and packs the whole refs when storage is "packed". So during these three runs of the for-loop, the preparation part quoted above behaves this way:

    storage=loose	no 'git pack-refs' run and every ref is loose
    storage=packed	the later 'git pack-refs' packs everything
    storage=mixed	'packed' tag is packed, everything else is loose

and the test checks what happens in this repository with refs packed in three different ways.

Previous: D. Ben KnobleNext: Harald Nordgren
Message 4 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.