summaryrefslogtreecommitdiff
path: root/include/git2/config.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-03-13 17:11:34 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-04-18 16:03:01 +0200
commit55ebd7d369a789f27fe1ad6b8ec8965aa1335d08 (patch)
tree16ec80013850add231a1c01bdc3de6e93f17cbaa /include/git2/config.h
parent36913b8cb497487728ee9bab383d4c1205685927 (diff)
downloadlibgit2-55ebd7d369a789f27fe1ad6b8ec8965aa1335d08.tar.gz
config: implement config snapshotting
In order to have consistent views of the config files for remotes, submodules et al. and a configuration that represents what is currently stored on-disk, we need a way to provide a view of the configuration that does not change. The goal here is to provide the snapshotting part by creating a read-only copy of the state of the configuration at a particular point in time, which does not change when a repository's main config changes.
Diffstat (limited to 'include/git2/config.h')
-rw-r--r--include/git2/config.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h
index 663b4f6ba..86c4012ed 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -226,6 +226,19 @@ GIT_EXTERN(int) git_config_open_level(
*/
GIT_EXTERN(int) git_config_open_global(git_config **out, git_config *config);
+/**
+ * Create a snapshot of the configuration
+ *
+ * Create a snapshot of the current state of a configuration, which
+ * allows you to look into a consistent view of the configuration for
+ * looking up complex values (e.g. a remote, submodule).
+ *
+ * @param out pointer in which to store the snapshot config object
+ * @param config configuration to snapshot
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_config_snapshot(git_config **out, git_config *config);
+
/**
* Reload changed config files