diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-07-12 12:50:23 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-08-12 04:09:38 +0200 |
commit | 5340d63d3815ddbd1a7e1b5b9628fce10089e8a0 (patch) | |
tree | 6a57d0912531b4dc6dc13b2f9d8aec4ebbc98c9b /include/git2/config.h | |
parent | 36f784b538c4b27f7b52427d2cfce06c535abba0 (diff) | |
download | libgit2-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 'include/git2/config.h')
-rw-r--r-- | include/git2/config.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index 2550f8edb..05c3ad622 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -696,25 +696,16 @@ GIT_EXTERN(int) git_config_backend_foreach_match( * 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 + * You can apply the changes by calling `git_transaction_commit()` + * before freeing the transaction. Either of these actions will unlock + * the config. * - * 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 + * @param tx the resulting transaction, use this to commit or undo the + * changes + * @param cfg the configuration in which to lock * @return 0 or an error code */ -GIT_EXTERN(int) git_config_unlock(git_config *cfg, int commit); - +GIT_EXTERN(int) git_config_lock(git_transaction **tx, git_config *cfg); /** @} */ GIT_END_DECL |