summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-07 11:34:32 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-07 11:34:32 +0200
commitac99d86ba5e2a9d2332b7f82737e1231c621dc43 (patch)
treed9950f8a80d7ac05b64396a608b64a8d4dcd3149 /src/remote.c
parent2280b388c913cbc4eee35ce99c760316206e2703 (diff)
downloadlibgit2-cmn/config-snapshot.tar.gz
repository: introduce a convenience config snapshot methodcmn/config-snapshot
Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/remote.c b/src/remote.c
index 3a754d4bd..0a6b72fb9 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -347,7 +347,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
git_buf buf = GIT_BUF_INIT;
const char *val;
int error = 0;
- git_config *config, *repo_config;
+ git_config *config;
struct refspec_cb_data data = { NULL };
bool optional_setting_found = false, found;
@@ -356,10 +356,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
if ((error = ensure_remote_name_is_valid(name)) < 0)
return error;
- if (git_repository_config__weakptr(&repo_config, repo) < 0)
- return -1;
-
- if ((error = git_config_snapshot(&config, repo_config)) < 0)
+ if ((error = git_repository_config_snapshot(&config, repo)) < 0)
return error;
remote = git__malloc(sizeof(git_remote));