summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
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 /include/git2/repository.h
parent2280b388c913cbc4eee35ce99c760316206e2703 (diff)
downloadlibgit2-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.h14
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