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 /src/config.c | |
parent | 36f784b538c4b27f7b52427d2cfce06c535abba0 (diff) | |
download | libgit2-cmn/config-tx.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.c')
-rw-r--r-- | src/config.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index 937d00dcb..2df1fc80e 100644 --- a/src/config.c +++ b/src/config.c @@ -1144,8 +1144,9 @@ int git_config_open_default(git_config **out) return error; } -int git_config_lock(git_config *cfg) +int git_config_lock(git_transaction **out, git_config *cfg) { + int error; git_config_backend *file; file_internal *internal; @@ -1156,7 +1157,10 @@ int git_config_lock(git_config *cfg) } file = internal->file; - return file->lock(file); + if ((error = file->lock(file)) < 0) + return error; + + return git_transaction_config_new(out, cfg); } int git_config_unlock(git_config *cfg, int commit) |