]> git.ipfire.org Git - thirdparty/git.git/commit
environment: stop storing "core.warnAmbiguousRefs" globally
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Sep 2024 11:30:24 +0000 (13:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Sep 2024 17:15:44 +0000 (10:15 -0700)
commit11dbb4ace3ac428574fadf6f7895f56aba9dca81
treeca7a3d3afd87150d5fb2f369a52fb97da6b829cb
parent8e2e8a33f3558524adeceeb1e2e7b64a367b0d08
environment: stop storing "core.warnAmbiguousRefs" globally

Same as the preceding commits, storing the "core.warnAmbiguousRefs"
value globally is misdesigned as this setting may be set per repository.

Move the logic into the repo-settings subsystem. The usual pattern here
is that users are expected to call `prepare_repo_settings()` before they
access the settings themselves. This seems somewhat fragile though, as
it is easy to miss and leads to somewhat ugly code patterns at the call
sites.

Instead, introduce a new function that encapsulates this logic for us.
This also allows us to change how exactly the lazy initialization works
in the future, e.g. by only partially initializing values as requested
by the caller.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c
config.c
environment.c
environment.h
object-name.c
ref-filter.c
refs.c
repo-settings.c
repo-settings.h