diff options
author | Brandon Williams <bmwill@google.com> | 2017-06-14 11:07:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-15 12:56:22 -0700 |
commit | dc8441fdb4598f54865a5c783d1f86c1e0bcb6dc (patch) | |
tree | 176279ca26cbd437316f434c609cd853eebca2a8 /config.h | |
parent | a577fb5fdc53a4729eeedc2922d1461350b92f73 (diff) | |
download | git-dc8441fdb4598f54865a5c783d1f86c1e0bcb6dc.tar.gz |
config: don't implicitly use gitdir or commondirbw/config-h
'git_config_with_options()' takes a 'config_options' struct which
contains feilds for 'git_dir' and 'commondir'. If those feilds happen
to be NULL the config machinery falls back to querying global repository
state. Let's change this and instead use these fields in the
'config_options' struct explicilty all the time. Since the API is
slightly changing to require these two fields to be set if callers want
the config machinery to load the repository's config, let's change the
name to 'config_with_optison()'. This allows the config machinery to
not implicitly rely on any global repository state.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -45,9 +45,9 @@ extern void git_config_push_parameter(const char *text); extern int git_config_from_parameters(config_fn_t fn, void *data); extern void read_early_config(config_fn_t cb, void *data); extern void git_config(config_fn_t fn, void *); -extern int git_config_with_options(config_fn_t fn, void *, - struct git_config_source *config_source, - const struct config_options *opts); +extern int config_with_options(config_fn_t fn, void *, + struct git_config_source *config_source, + const struct config_options *opts); extern int git_parse_ulong(const char *, unsigned long *); extern int git_parse_maybe_bool(const char *); extern int git_config_int(const char *, const char *); |