summaryrefslogtreecommitdiff
path: root/include/git2/sys
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-08-13 10:22:50 -0700
committerEdward Thomson <ethomson@edwardthomson.com>2015-08-13 10:22:50 -0700
commit9f1af7f279e9f5cbd03c9a9d78fcba77a1c2c64c (patch)
tree5250a876c2fe2ba49edcd7e662214baa53dd1f0f /include/git2/sys
parent1573acbbd9023b5c447caa7489f9579d8ffc810e (diff)
parent5340d63d3815ddbd1a7e1b5b9628fce10089e8a0 (diff)
downloadlibgit2-9f1af7f279e9f5cbd03c9a9d78fcba77a1c2c64c.tar.gz
Merge pull request #3168 from libgit2/cmn/config-tx
Locking and transactional/atomic updates for config
Diffstat (limited to 'include/git2/sys')
-rw-r--r--include/git2/sys/config.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/git2/sys/config.h b/include/git2/sys/config.h
index 044e34417..4dad6da42 100644
--- a/include/git2/sys/config.h
+++ b/include/git2/sys/config.h
@@ -67,6 +67,20 @@ struct git_config_backend {
int (*iterator)(git_config_iterator **, struct git_config_backend *);
/** Produce a read-only version of this backend */
int (*snapshot)(struct git_config_backend **, struct git_config_backend *);
+ /**
+ * Lock this backend.
+ *
+ * Prevent any writes to the data store backing this
+ * backend. Any updates must not be visible to any other
+ * readers.
+ */
+ int (*lock)(struct git_config_backend *);
+ /**
+ * Unlock the data store backing this backend. If success is
+ * true, the changes should be committed, otherwise rolled
+ * back.
+ */
+ int (*unlock)(struct git_config_backend *, int success);
void (*free)(struct git_config_backend *);
};
#define GIT_CONFIG_BACKEND_VERSION 1