diff options
author | Matthew Rogers <mattr94@gmail.com> | 2020-02-10 01:30:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-10 19:49:12 +0100 |
commit | 9a83d088ee00dcdab171b2020ab334e369437a33 (patch) | |
tree | 8b21354f71400dc4fca02ff91bd76210b3c91b02 /submodule-config.c | |
parent | config: teach git_config_source to remember its scope (diff) | |
download | git-9a83d088ee00dcdab171b2020ab334e369437a33.tar.xz git-9a83d088ee00dcdab171b2020ab334e369437a33.zip |
submodule-config: add subomdule config scope
Before the changes to teach git_config_source to remember scope
information submodule-config.c never needed to consider the question of
config scope. Even though zeroing out git_config_source is still
correct and preserved the previous behavior of setting the scope to
CONFIG_SCOPE_UNKNOWN, it's better to be explicit about such situations
by explicitly setting the scope. As none of the current config_scope
enumerations make sense we create CONFIG_SCOPE_SUBMODULE to describe the
situation.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/submodule-config.c b/submodule-config.c index 85064810b2..b8e97d8ae8 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -635,7 +635,9 @@ static void submodule_cache_check_init(struct repository *repo) static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void *data) { if (repo->worktree) { - struct git_config_source config_source = { 0 }; + struct git_config_source config_source = { + 0, .scope = CONFIG_SCOPE_SUBMODULE + }; const struct config_options opts = { 0 }; struct object_id oid; char *file; |