summaryrefslogtreecommitdiff
path: root/src/submodule.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-05-23 11:51:00 +0200
committerPatrick Steinhardt <ps@pks.im>2017-10-09 11:19:42 +0200
commit529e873cef18ec98246d32d28c7a0b0e3467fe27 (patch)
treef810490f62966f39ea9c86e041b8102956d2306f /src/submodule.c
parentd02cf564a012ea8f6d4d4fd70a3102b94058f759 (diff)
downloadlibgit2-529e873cef18ec98246d32d28c7a0b0e3467fe27.tar.gz
config: pass repository when opening config files
Our current configuration logic is completely oblivious of any repository, but only cares for actual file paths. Unfortunately, we are forced to break this assumption by the introduction of conditional includes, which are evaluated in the context of a repository. Right now, only one conditional exists with "gitdir:" -- it will only include the configuration if the current repository's git directory matches the value passed to "gitdir:". To support these conditionals, we have to break our API and make the repository available when opening a configuration file. This commit extends the `open` call of configuration backends to include another repository and adjusts existing code to have it available. This includes the user-visible functions `git_config_add_file_ondisk` and `git_config_add_backend`.
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c
index 6c3e5f6bd..3ec0307b3 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1960,7 +1960,7 @@ static git_config_backend *open_gitmodules(
if (git_config_file__ondisk(&mods, path.ptr) < 0)
mods = NULL;
/* open should only fail here if the file is malformed */
- else if (git_config_file_open(mods, GIT_CONFIG_LEVEL_LOCAL) < 0) {
+ else if (git_config_file_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) {
git_config_file_free(mods);
mods = NULL;
}