summaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-07-12 12:50:23 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-12 04:09:38 +0200
commit5340d63d3815ddbd1a7e1b5b9628fce10089e8a0 (patch)
tree6a57d0912531b4dc6dc13b2f9d8aec4ebbc98c9b /src/config.h
parent36f784b538c4b27f7b52427d2cfce06c535abba0 (diff)
downloadlibgit2-5340d63d3815ddbd1a7e1b5b9628fce10089e8a0.tar.gz
config: perform unlocking via git_transactioncmn/config-tx
This makes the API for commiting or discarding changes the same as for references.
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.h b/src/config.h
index f257cc90f..ba745331a 100644
--- a/src/config.h
+++ b/src/config.h
@@ -88,4 +88,19 @@ extern int git_config__cvar(
*/
int git_config_lookup_map_enum(git_cvar_t *type_out, const char **str_out,
const git_cvar_map *maps, size_t map_n, int enum_val);
+
+/**
+ * Unlock the backend with the highest priority
+ *
+ * Unlocking will allow other writers to updat the configuration
+ * file. Optionally, any changes performed since the lock will be
+ * applied to the configuration.
+ *
+ * @param cfg the configuration
+ * @param commit boolean which indicates whether to commit any changes
+ * done since locking
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_config_unlock(git_config *cfg, int commit);
+
#endif