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 /include/git2/repository.h | |
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 'include/git2/repository.h')
-rw-r--r-- | include/git2/repository.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index 4433e71a2..37140d48a 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -409,13 +409,25 @@ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); * The configuration file must be freed once it's no longer * being used by the user. * - * @param out Pointer to store the loaded config file + * @param out Pointer to store the loaded configuration * @param repo A repository object * @return 0, or an error code */ GIT_EXTERN(int) git_repository_config(git_config **out, git_repository *repo); /** + * Get a snapshot of the repository's configuration + * + * Convenience function to take a snapshot from the repository's + * configuration. + * + * @param out Pointer to store the loaded configuration + * @param repo the repository + * @return 0, or an error code + */ +GIT_EXTERN(int) git_repository_config_snapshot(git_config **out, git_repository *repo); + +/** * Get the Object Database for this repository. * * If a custom ODB has not been set, the default |