]> git.ipfire.org Git - thirdparty/git.git/commit
config: make dependency on repo in `read_early_config()` explicit
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Sep 2024 11:29:45 +0000 (13:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Sep 2024 17:15:40 +0000 (10:15 -0700)
commitb92266b79c7bb741e3600e9dc206b693d8062fa9
tree33f43c13c0dd58b470e91cab1caf0bccf24422ab
parentc0b03e8b6d9361277557ac93b23980d7fe6e751b
config: make dependency on repo in `read_early_config()` explicit

The `read_early_config()` function can be used to read configuration
where a repository has not yet been set up. As such, it is optional
whether or not `the_repository` has already been initialized. If it was
initialized we use its commondir and gitdir. If not, the function will
try to detect the Git directories by itself and, if found, also parse
their config files.

This means that we implicitly rely on `the_repository`. Make this
dependency explicit by passing a `struct repository`. This allows us to
again drop the `USE_THE_REPOSITORY_VARIABLE` define in "config.c".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
alias.c
config.c
config.h
help.c
pager.c
t/helper/test-config.c
trace2/tr2_cfg.c