diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-09-12 13:29:45 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-12 19:15:40 +0200 |
commit | b92266b79c7bb741e3600e9dc206b693d8062fa9 (patch) | |
tree | 33f43c13c0dd58b470e91cab1caf0bccf24422ab /config.h | |
parent | config: document `read_early_config()` and `read_very_early_config()` (diff) | |
download | git-b92266b79c7bb741e3600e9dc206b693d8062fa9.tar.xz git-b92266b79c7bb741e3600e9dc206b693d8062fa9.zip |
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>
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -198,7 +198,7 @@ int git_config_from_parameters(config_fn_t fn, void *data); * `the_repository` has not yet been set up, try to discover the Git * directory to read the configuration from. */ -void read_early_config(config_fn_t cb, void *data); +void read_early_config(struct repository *repo, config_fn_t cb, void *data); /* * Read config but only enumerate system and global settings. |