diff options
Diffstat (limited to 'include/git2/config.h')
-rw-r--r-- | include/git2/config.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index 6d3fdb0c2..2550f8edb 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -689,6 +689,33 @@ GIT_EXTERN(int) git_config_backend_foreach_match( void *payload); +/** + * Lock the backend with the highest priority + * + * Locking disallows anybody else from writing to that backend. Any + * updates made after locking will not be visible to a reader until + * the file is unlocked. + * + * @param cfg the configuration in which to lock + * @return 0 or an error code + */ +GIT_EXTERN(int) git_config_lock(git_config *cfg); + +/** + * 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); + + /** @} */ GIT_END_DECL #endif |