summaryrefslogtreecommitdiff
path: root/tests/config/write.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 /tests/config/write.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 'tests/config/write.c')
-rw-r--r--tests/config/write.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/config/write.c b/tests/config/write.c
index 56ef2e9fb..44131cffa 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -93,9 +93,9 @@ void test_config_write__delete_value_at_specific_level(void)
cl_git_pass(git_config_new(&cfg));
cl_git_pass(git_config_add_file_ondisk(cfg, "config9",
- GIT_CONFIG_LEVEL_LOCAL, 0));
+ GIT_CONFIG_LEVEL_LOCAL, NULL, 0));
cl_git_pass(git_config_add_file_ondisk(cfg, "config15",
- GIT_CONFIG_LEVEL_GLOBAL, 0));
+ GIT_CONFIG_LEVEL_GLOBAL, NULL, 0));
cl_git_pass(git_config_open_level(&cfg_specific, cfg, GIT_CONFIG_LEVEL_GLOBAL));
@@ -368,9 +368,9 @@ void test_config_write__add_value_at_specific_level(void)
// open config15 as global level config file
cl_git_pass(git_config_new(&cfg));
cl_git_pass(git_config_add_file_ondisk(cfg, "config9",
- GIT_CONFIG_LEVEL_LOCAL, 0));
+ GIT_CONFIG_LEVEL_LOCAL, NULL, 0));
cl_git_pass(git_config_add_file_ondisk(cfg, "config15",
- GIT_CONFIG_LEVEL_GLOBAL, 0));
+ GIT_CONFIG_LEVEL_GLOBAL, NULL, 0));
cl_git_pass(git_config_open_level(&cfg_specific, cfg, GIT_CONFIG_LEVEL_GLOBAL));