diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-04 17:31:42 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-04 17:31:42 +0200 |
commit | 57cb1179e5c9c8f5c27c9115f13f1cae5d0f87a0 (patch) | |
tree | 67871086b1437dcd410979b423cd3ba140ab9257 /tests/diff/rename.c | |
parent | 90befde4a1938641dfdb9a7bdb9f361d1de5c26f (diff) | |
download | libgit2-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/diff/rename.c')
-rw-r--r-- | tests/diff/rename.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/diff/rename.c b/tests/diff/rename.c index 4bc3eb54c..c226ec4a1 100644 --- a/tests/diff/rename.c +++ b/tests/diff/rename.c @@ -1426,7 +1426,7 @@ void test_diff_rename__matches_config_behavior(void) tree2 = resolve_commit_oid_to_tree(g_repo, sha2); diffopts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_writable(&cfg, g_repo)); /* diff.renames = false; no rename detection should happen */ cl_git_pass(git_config_set_bool(cfg, "diff.renames", false)); @@ -1508,7 +1508,7 @@ void test_diff_rename__can_override_thresholds_when_obeying_config(void) diffopts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; opts.flags = GIT_DIFF_FIND_BY_CONFIG; - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_writable(&cfg, g_repo)); cl_git_pass(git_config_set_string(cfg, "diff.renames", "copies")); git_config_free(cfg); @@ -1563,7 +1563,7 @@ void test_diff_rename__by_config_doesnt_mess_with_whitespace_settings(void) diffopts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; opts.flags = GIT_DIFF_FIND_BY_CONFIG; - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_writable(&cfg, g_repo)); cl_git_pass(git_config_set_string(cfg, "diff.renames", "copies")); git_config_free(cfg); |