diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-03-15 03:53:36 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-04-18 16:03:01 +0200 |
commit | 29c4cb0965b67ad1ae7f640dfee67cf3ce358c26 (patch) | |
tree | 6aaaea724b43049fdc045ae1ea6c043f44e34c0d /src/signature.c | |
parent | 55ebd7d369a789f27fe1ad6b8ec8965aa1335d08 (diff) | |
download | libgit2-29c4cb0965b67ad1ae7f640dfee67cf3ce358c26.tar.gz |
Use config snapshotting
This way we can assume we have a consistent view of the config situation
when we're looking up remote, branch, pack-objects, etc.
Diffstat (limited to 'src/signature.c')
-rw-r--r-- | src/signature.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/signature.c b/src/signature.c index f501cd8b6..b0ee0da74 100644 --- a/src/signature.c +++ b/src/signature.c @@ -141,10 +141,13 @@ 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; + git_config *cfg, *repo_cfg; const char *user_name, *user_email; - if ((error = git_repository_config(&cfg, repo)) < 0) + if ((error = git_repository_config__weakptr(&repo_cfg, repo)) < 0) + return error; + + if ((error = git_config_snapshot(&cfg, repo_cfg)) < 0) return error; if (!(error = git_config_get_string(&user_name, cfg, "user.name")) && |