diff options
author | Glen Choo <chooglen@google.com> | 2023-06-28 22:26:24 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-29 00:06:39 +0300 |
commit | 809d868061c5e55e9b3bd59a4118628318eb46e9 (patch) | |
tree | 3f87f874677594a0fd3393b76f88875f058682d7 /submodule-config.c | |
parent | 6021e1d1580169532512772afbb86996f717f4ae (diff) |
config: pass ctx with config files
Pass config_context to config_callbacks when parsing config files. To
provide the .kvi member, refactor out the configset logic that caches
"struct config_source" and "enum config_scope" as a "struct
key_value_info". Make the "enum config_scope" available to the config
file machinery by plumbing an additional arg through
git_config_from_file_with_options().
We do not exercise ctx yet because the remaining current_config_*()
callers may be used with config_with_options(), which may read config
from parameters, but parameters don't pass ctx yet.
Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.c')
-rw-r--r-- | submodule-config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/submodule-config.c b/submodule-config.c index a38d4d4973..3f25bd1367 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -606,7 +606,7 @@ static const struct submodule *config_from(struct submodule_cache *cache, parameter.gitmodules_oid = &oid; parameter.overwrite = 0; git_config_from_mem(parse_config, CONFIG_ORIGIN_SUBMODULE_BLOB, rev.buf, - config, config_size, ¶meter, NULL); + config, config_size, ¶meter, CONFIG_SCOPE_UNKNOWN, NULL); strbuf_release(&rev); free(config); @@ -714,7 +714,8 @@ void gitmodules_config_oid(const struct object_id *commit_oid) if (gitmodule_oid_from_commit(commit_oid, &oid, &rev)) { git_config_from_blob_oid(gitmodules_cb, rev.buf, - the_repository, &oid, the_repository); + the_repository, &oid, the_repository, + CONFIG_SCOPE_UNKNOWN); } strbuf_release(&rev); |