summaryrefslogtreecommitdiff
path: root/tests/revert/workdir.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-06-04 17:31:42 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-06-04 17:31:42 +0200
commit57cb1179e5c9c8f5c27c9115f13f1cae5d0f87a0 (patch)
tree67871086b1437dcd410979b423cd3ba140ab9257 /tests/revert/workdir.c
parent90befde4a1938641dfdb9a7bdb9f361d1de5c26f (diff)
downloadlibgit2-cmn/config-default-snapshot.tar.gz
Make the default repository config getter return a snapshotcmn/config-default-snapshot
You should always use a snapshot, with the sole exception of writing to the configuration. Any reads that are not against a snapshot have race conditions, both in terms of returned values as well as dangling pointers.
Diffstat (limited to 'tests/revert/workdir.c')
-rw-r--r--tests/revert/workdir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index e3d7e968a..9887a067a 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -21,7 +21,7 @@ void test_revert_workdir__initialize(void)
git_repository_index(&repo_index, repo);
/* Ensure that the user's merge.conflictstyle doesn't interfere */
- cl_git_pass(git_repository_config(&cfg, repo));
+ cl_git_pass(git_repository_config_writable(&cfg, repo));
cl_git_pass(git_config_set_string(cfg, "merge.conflictstyle", "merge"));
git_config_free(cfg);
}
@@ -321,7 +321,7 @@ void test_revert_workdir__again_after_edit_two(void)
{ 0100644, "21a96a98ed84d45866e1de6e266fd3a61a4ae9dc", 3, "file.txt" },
};
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_set_bool(config, "core.autocrlf", 0));
cl_git_pass(git_oid_fromstr(&head_commit_oid, "e34ef1afe54eb526fd92eec66084125f340f1d65"));