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/signature.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/signature.c')
-rw-r--r-- | src/signature.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/signature.c b/src/signature.c index b0ee0da74..2545b7519 100644 --- a/src/signature.c +++ b/src/signature.c @@ -141,13 +141,10 @@ int git_signature_now(git_signature **sig_out, const char *name, const char *ema int git_signature_default(git_signature **out, git_repository *repo) { int error; - git_config *cfg, *repo_cfg; + git_config *cfg; const char *user_name, *user_email; - if ((error = git_repository_config__weakptr(&repo_cfg, repo)) < 0) - return error; - - if ((error = git_config_snapshot(&cfg, repo_cfg)) < 0) + if ((error = git_repository_config_snapshot(&cfg, repo)) < 0) return error; if (!(error = git_config_get_string(&user_name, cfg, "user.name")) && |