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 /tests/config/write.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 'tests/config/write.c')
-rw-r--r-- | tests/config/write.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/config/write.c b/tests/config/write.c index e43c26bd9..3d9b1a16a 100644 --- a/tests/config/write.c +++ b/tests/config/write.c @@ -637,6 +637,7 @@ void test_config_write__locking(void) { git_config *cfg, *cfg2; git_config_entry *entry; + git_transaction *tx; const char *filename = "locked-file"; /* Open the config and lock it */ @@ -645,7 +646,7 @@ void test_config_write__locking(void) cl_git_pass(git_config_get_entry(&entry, cfg, "section.name")); cl_assert_equal_s("value", entry->value); git_config_entry_free(entry); - cl_git_pass(git_config_lock(cfg)); + cl_git_pass(git_config_lock(&tx, cfg)); /* Change entries in the locked backend */ cl_git_pass(git_config_set_string(cfg, "section.name", "other value")); @@ -665,8 +666,8 @@ void test_config_write__locking(void) git_config_entry_free(entry); cl_git_fail_with(GIT_ENOTFOUND, git_config_get_entry(&entry, cfg, "section2.name3")); - git_config_unlock(cfg, true); - git_config_free(cfg); + cl_git_pass(git_transaction_commit(tx)); + git_transaction_free(tx); /* Now that we've unlocked it, we should see both updates */ cl_git_pass(git_config_open_ondisk(&cfg, filename)); |