if (tx->type == TRANSACTION_CONFIG) {
error = git_config_unlock(tx->cfg, true);
- git_config_free(tx->cfg);
tx->cfg = NULL;
return error;
git_transaction_free(tx);
/* Now that we've unlocked it, we should see both updates */
+ cl_git_pass(git_config_get_entry(&entry, cfg, "section.name"));
+ cl_assert_equal_s("other value", entry->value);
+ git_config_entry_free(entry);
+ cl_git_pass(git_config_get_entry(&entry, cfg, "section2.name3"));
+ cl_assert_equal_s("more value", entry->value);
+ git_config_entry_free(entry);
+
+ git_config_free(cfg);
+
+ /* We should also see the changes after reopening the config */
cl_git_pass(git_config_open_ondisk(&cfg, filename));
cl_git_pass(git_config_get_entry(&entry, cfg, "section.name"));
cl_assert_equal_s("other value", entry->value);