diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-07 11:34:32 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-07 11:34:32 +0200 |
commit | ac99d86ba5e2a9d2332b7f82737e1231c621dc43 (patch) | |
tree | d9950f8a80d7ac05b64396a608b64a8d4dcd3149 /src/branch.c | |
parent | 2280b388c913cbc4eee35ce99c760316206e2703 (diff) | |
download | libgit2-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/branch.c')
-rw-r--r-- | src/branch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/branch.c b/src/branch.c index d8c82b73e..52760853b 100644 --- a/src/branch.c +++ b/src/branch.c @@ -332,7 +332,7 @@ int git_branch_upstream_name( int error = -1; git_remote *remote = NULL; const git_refspec *refspec; - git_config *config, *repo_config; + git_config *config; assert(out && refname); @@ -341,10 +341,7 @@ int git_branch_upstream_name( if (!git_reference__is_branch(refname)) return not_a_local_branch(refname); - if ((error = git_repository_config__weakptr(&repo_config, repo)) < 0) - return error; - - if ((error = git_config_snapshot(&config, repo_config)) < 0) + if ((error = git_repository_config_snapshot(&config, repo)) < 0) return error; if ((error = retrieve_upstream_configuration( |