summaryrefslogtreecommitdiff
path: root/src/pack-objects.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/pack-objects.c
parent2280b388c913cbc4eee35ce99c760316206e2703 (diff)
downloadlibgit2-ac99d86ba5e2a9d2332b7f82737e1231c621dc43.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/pack-objects.c')
-rw-r--r--src/pack-objects.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c
index e7c7f391f..882ddf544 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -86,14 +86,11 @@ static unsigned name_hash(const char *name)
static int packbuilder_config(git_packbuilder *pb)
{
- git_config *config, *repo_config;
+ git_config *config;
int ret;
int64_t val;
- if ((ret = git_repository_config__weakptr(&repo_config, pb->repo)) < 0)
- return ret;
-
- if ((ret = git_config_snapshot(&config, repo_config)) < 0)
+ if ((ret = git_repository_config_snapshot(&config, pb->repo)) < 0)
return ret;
#define config_get(KEY,DST,DFLT) do { \