diff options
| author | Patrick Steinhardt <ps@pks.im> | 2018-08-10 13:03:33 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2018-09-28 11:14:13 +0200 |
| commit | b944e13782370844823fcdc712fefcde3bb3fe73 (patch) | |
| tree | c683c316553c2ef40661f6119913d9b51de9e2cd /src/submodule.c | |
| parent | 1aeff5d7c97eac81965d09b0fac8e89ddb6909be (diff) | |
| download | libgit2-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 'src/submodule.c')
| -rw-r--r-- | src/submodule.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/submodule.c b/src/submodule.c index c7fd50c77..9231f08b1 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -15,7 +15,7 @@ #include "buf_text.h" #include "vector.h" #include "posix.h" -#include "config_file.h" +#include "config_backend.h" #include "config.h" #include "repository.h" #include "tree.h" @@ -335,9 +335,9 @@ int git_submodule_lookup( mods = open_gitmodules(repo, GITMODULES_EXISTING); if (mods) - error = git_config_file_foreach_match(mods, pattern, find_by_path, &data); + error = git_config_backend_foreach_match(mods, pattern, find_by_path, &data); - git_config_file_free(mods); + git_config_backend_free(mods); if (error < 0) { git_submodule_free(sm); @@ -794,11 +794,11 @@ int git_submodule_add_setup( } if ((error = git_buf_printf(&name, "submodule.%s.path", path)) < 0 || - (error = git_config_file_set_string(mods, name.ptr, path)) < 0) + (error = git_config_backend_set_string(mods, name.ptr, path)) < 0) goto cleanup; if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 || - (error = git_config_file_set_string(mods, name.ptr, url)) < 0) + (error = git_config_backend_set_string(mods, name.ptr, url)) < 0) goto cleanup; git_buf_clear(&name); @@ -836,7 +836,7 @@ cleanup: if (out != NULL) *out = sm; - git_config_file_free(mods); + git_config_backend_free(mods); git_repository_free(subrepo); git_buf_dispose(&real_url); git_buf_dispose(&name); @@ -1035,14 +1035,14 @@ static int write_var(git_repository *repo, const char *name, const char *var, co goto cleanup; if (val) - error = git_config_file_set_string(mods, key.ptr, val); + error = git_config_backend_set_string(mods, key.ptr, val); else - error = git_config_file_delete(mods, key.ptr); + error = git_config_backend_delete(mods, key.ptr); git_buf_dispose(&key); cleanup: - git_config_file_free(mods); + git_config_backend_free(mods); return error; } @@ -2072,12 +2072,12 @@ static git_config_backend *open_gitmodules( return NULL; if (okay_to_create || git_path_isfile(path.ptr)) { - /* git_config_file__ondisk should only fail if OOM */ - if (git_config_file__ondisk(&mods, path.ptr) < 0) + /* git_config_backend_from_file should only fail if OOM */ + if (git_config_backend_from_file(&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, repo) < 0) { - git_config_file_free(mods); + else if (git_config_backend_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) { + git_config_backend_free(mods); mods = NULL; } } |
