]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files: lazy-load configuration to fix chicken-and-egg
authorPatrick Steinhardt <ps@pks.im>
Thu, 25 Jun 2026 09:20:06 +0000 (11:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jun 2026 15:27:19 +0000 (08:27 -0700)
commitf016ec17fbbde5ae7d208f0585bc02eb63416a53
treec00f2aa9a3d3dbae85fb85b6016a0c53a8ce20e2
parenta9e4ce0aec738ca3047d77f3781159424703a2a3
refs/files: lazy-load configuration to fix chicken-and-egg

When initializing the "files" reference backend we read the repository's
config to parse "core.preferSymlinkRefs" and "core.logAllRefUpdates".
This results in a chicken-and-egg problem though, because parsing the
configuration may require us to have access to the reference store
already when an "onbranch" condition exists.

Luckily, all the configuration that we honor only relates to writing
references. Consequently, we don't strictly need that configuration to
be readily available at initialization time, and we can easiliy defer
parsing it to a later point in time.

Implement this fix and add tests that verify that we can indeed properly
parse these config knobs via an "onbranch" condition.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
t/t0600-reffiles-backend.sh