summaryrefslogtreecommitdiff
path: root/tests/config
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-08-10 13:03:33 +0200
committerPatrick Steinhardt <ps@pks.im>2018-09-28 11:14:13 +0200
commitb944e13782370844823fcdc712fefcde3bb3fe73 (patch)
treec683c316553c2ef40661f6119913d9b51de9e2cd /tests/config
parent1aeff5d7c97eac81965d09b0fac8e89ddb6909be (diff)
downloadlibgit2-b944e13782370844823fcdc712fefcde3bb3fe73.tar.gz
config: rename "config_file.h" to "config_backend.h"
The header "config_file.h" has a list of inline-functions to access the contents of a config backend without directly messing with the struct's function pointers. While all these functions are called "git_config_file_*", they are in fact completely backend-agnostic and don't care whether it is a file or not. Rename all the function to instead be backend-agnostic versions called "git_config_backend_*" and rename the header to match.
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/readonly.c12
-rw-r--r--tests/config/write.c1
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/config/readonly.c b/tests/config/readonly.c
index a424922c1..5d544b8cb 100644
--- a/tests/config/readonly.c
+++ b/tests/config/readonly.c
@@ -1,5 +1,5 @@
#include "clar_libgit2.h"
-#include "config_file.h"
+#include "config_backend.h"
#include "config.h"
#include "path.h"
@@ -20,7 +20,7 @@ void test_config_readonly__writing_to_readonly_fails(void)
{
git_config_backend *backend;
- cl_git_pass(git_config_file__ondisk(&backend, "global"));
+ cl_git_pass(git_config_backend_from_file(&backend, "global"));
backend->readonly = 1;
cl_git_pass(git_config_add_backend(cfg, backend, GIT_CONFIG_LEVEL_GLOBAL, NULL, 0));
@@ -32,11 +32,11 @@ void test_config_readonly__writing_to_cfg_with_rw_precedence_succeeds(void)
{
git_config_backend *backend;
- cl_git_pass(git_config_file__ondisk(&backend, "global"));
+ cl_git_pass(git_config_backend_from_file(&backend, "global"));
backend->readonly = 1;
cl_git_pass(git_config_add_backend(cfg, backend, GIT_CONFIG_LEVEL_GLOBAL, NULL, 0));
- cl_git_pass(git_config_file__ondisk(&backend, "local"));
+ cl_git_pass(git_config_backend_from_file(&backend, "local"));
cl_git_pass(git_config_add_backend(cfg, backend, GIT_CONFIG_LEVEL_LOCAL, NULL, 0));
cl_git_pass(git_config_set_string(cfg, "foo.bar", "baz"));
@@ -50,11 +50,11 @@ void test_config_readonly__writing_to_cfg_with_ro_precedence_succeeds(void)
{
git_config_backend *backend;
- cl_git_pass(git_config_file__ondisk(&backend, "local"));
+ cl_git_pass(git_config_backend_from_file(&backend, "local"));
backend->readonly = 1;
cl_git_pass(git_config_add_backend(cfg, backend, GIT_CONFIG_LEVEL_LOCAL, NULL, 0));
- cl_git_pass(git_config_file__ondisk(&backend, "global"));
+ cl_git_pass(git_config_backend_from_file(&backend, "global"));
cl_git_pass(git_config_add_backend(cfg, backend, GIT_CONFIG_LEVEL_GLOBAL, NULL, 0));
cl_git_pass(git_config_set_string(cfg, "foo.bar", "baz"));
diff --git a/tests/config/write.c b/tests/config/write.c
index 521dcb0ae..bd0f5b277 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -2,7 +2,6 @@
#include "buffer.h"
#include "fileops.h"
#include "git2/sys/config.h"
-#include "config_file.h"
#include "config.h"
void test_config_write__initialize(void)