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/diff_driver.c | |
parent | 2280b388c913cbc4eee35ce99c760316206e2703 (diff) | |
download | libgit2-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/diff_driver.c')
-rw-r--r-- | src/diff_driver.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/diff_driver.c b/src/diff_driver.c index 6e87fd6f8..28c0a6b17 100644 --- a/src/diff_driver.c +++ b/src/diff_driver.c @@ -234,14 +234,11 @@ static int git_diff_driver_load( } /* if you can't read config for repo, just use default driver */ - if (git_repository_config__weakptr(&repo_cfg, repo) < 0) { + if (git_repository_config_snapshot(&cfg, repo) < 0) { giterr_clear(); goto done; } - if ((error = git_config_snapshot(&cfg, repo_cfg)) < 0) - return error; - drv = git__calloc(1, sizeof(git_diff_driver) + namelen + 1); GITERR_CHECK_ALLOC(drv); drv->type = DIFF_DRIVER_AUTO; |