summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/attr/ignore.c2
-rw-r--r--tests/checkout/conflict.c2
-rw-r--r--tests/clar_libgit2.c4
-rw-r--r--tests/config/rename.c3
-rw-r--r--tests/config/write.c2
-rw-r--r--tests/diff/blob.c2
-rw-r--r--tests/diff/drivers.c4
-rw-r--r--tests/diff/patch.c2
-rw-r--r--tests/diff/rename.c6
-rw-r--r--tests/diff/submodules.c2
-rw-r--r--tests/diff/tree.c2
-rw-r--r--tests/merge/files.c2
-rw-r--r--tests/merge/workdir/analysis.c8
-rw-r--r--tests/merge/workdir/dirty.c2
-rw-r--r--tests/merge/workdir/renames.c2
-rw-r--r--tests/merge/workdir/simple.c8
-rw-r--r--tests/network/remote/createthenload.c2
-rw-r--r--tests/network/remote/remotes.c15
-rw-r--r--tests/notes/notesref.c2
-rw-r--r--tests/online/fetchhead.c2
-rw-r--r--tests/refs/branches/create.c2
-rw-r--r--tests/refs/branches/move.c2
-rw-r--r--tests/refs/branches/upstream.c7
-rw-r--r--tests/refs/reflog/reflog.c6
-rw-r--r--tests/repo/config.c4
-rw-r--r--tests/repo/init.c8
-rw-r--r--tests/repo/open.c2
-rw-r--r--tests/revert/workdir.c4
-rw-r--r--tests/status/ignore.c2
-rw-r--r--tests/submodule/modify.c2
30 files changed, 63 insertions, 50 deletions
diff --git a/tests/attr/ignore.c b/tests/attr/ignore.c
index b187db01c..312242d09 100644
--- a/tests/attr/ignore.c
+++ b/tests/attr/ignore.c
@@ -157,7 +157,7 @@ void test_attr_ignore__expand_tilde_to_homedir(void)
/* construct fake home with fake global excludes */
cl_git_mkfile("home/globalexclude", "# found me\n*.global_with_tilde\n");
- 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, "core.excludesfile", "~/globalexclude"));
git_config_free(cfg);
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index 2cb7c224d..5f1ddb3f6 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -71,7 +71,7 @@ void test_checkout_conflict__initialize(void)
"* text eol=lf\n");
/* Ensure that the user's merge.conflictstyle doesn't interfere */
- 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, "merge.conflictstyle", "merge"));
git_config_free(cfg);
}
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index 0a4c3e8e5..60a3d46e0 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -398,7 +398,7 @@ void cl_repo_commit_from_index(
void cl_repo_set_bool(git_repository *repo, const char *cfg, int value)
{
git_config *config;
- 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, cfg, value != 0));
git_config_free(config);
}
@@ -417,7 +417,7 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg)
void cl_repo_set_string(git_repository *repo, const char *cfg, const char *value)
{
git_config *config;
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_set_string(config, cfg, value));
git_config_free(config);
}
diff --git a/tests/config/rename.c b/tests/config/rename.c
index db07c798f..d28795ab3 100644
--- a/tests/config/rename.c
+++ b/tests/config/rename.c
@@ -7,7 +7,7 @@ static git_config *g_config = NULL;
void test_config_rename__initialize(void)
{
g_repo = cl_git_sandbox_init("testrepo.git");
- cl_git_pass(git_repository_config(&g_config, g_repo));
+ cl_git_pass(git_repository_config_writable(&g_config, g_repo));
}
void test_config_rename__cleanup(void)
@@ -55,6 +55,7 @@ void test_config_rename__prevent_overwrite(void)
cl_git_pass(git_config_rename_section(
g_repo, "branch.track-local", "branch.local-track"));
+
cl_git_pass(git_config_get_entry(
&ce, g_config, "branch.local-track.remote"));
cl_assert_equal_s(".", ce->value);
diff --git a/tests/config/write.c b/tests/config/write.c
index 402be9317..734360167 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -281,7 +281,7 @@ void test_config_write__can_set_an_empty_value(void)
const char * str;
repository = cl_git_sandbox_init("testrepo.git");
- cl_git_pass(git_repository_config(&config, repository));
+ cl_git_pass(git_repository_config_writable(&config, repository));
cl_git_pass(git_config_set_string(config, "core.somevar", ""));
cl_git_pass(git_config_get_string(&str, config, "core.somevar"));
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index 527007965..37a1ffd1e 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -796,7 +796,7 @@ void test_diff_blob__using_path_and_attributes(void)
/* set up custom diff drivers and 'diff' attribute mappings for them */
- 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_bool(cfg, "diff.iam_binary.binary", 1));
cl_git_pass(git_config_set_bool(cfg, "diff.iam_text.binary", 0));
cl_git_pass(git_config_set_string(
diff --git a/tests/diff/drivers.c b/tests/diff/drivers.c
index 8b12368ea..10443163c 100644
--- a/tests/diff/drivers.c
+++ b/tests/diff/drivers.c
@@ -101,7 +101,7 @@ void test_diff_drivers__patterns(void)
/* let's define that driver */
- 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_bool(cfg, "diff.kipling0.binary", 1));
git_config_free(cfg);
@@ -121,7 +121,7 @@ void test_diff_drivers__patterns(void)
git_diff_driver_registry_free(g_repo->diff_drivers);
g_repo->diff_drivers = NULL;
- 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_bool(cfg, "diff.kipling0.binary", 0));
cl_git_pass(git_config_set_string(cfg, "diff.kipling0.xfuncname", "^H.*$"));
git_config_free(cfg);
diff --git a/tests/diff/patch.c b/tests/diff/patch.c
index 1184d1968..5f9a74880 100644
--- a/tests/diff/patch.c
+++ b/tests/diff/patch.c
@@ -188,7 +188,7 @@ void test_diff_patch__config_options(void)
const char *expected4 = "diff --git staged_changes_modified_file staged_changes_modified_file\nindex 70bd9443ada0..906ee7711f4f 100644\n--- staged_changes_modified_file\n+++ staged_changes_modified_file\n@@ -1 +1,2 @@\n staged_changes_modified_file\n+staged_changes_modified_file\n";
g_repo = cl_git_sandbox_init("status");
- cl_git_pass(git_repository_config(&cfg, g_repo));
+ cl_git_pass(git_repository_config_writable(&cfg, g_repo));
one = resolve_commit_oid_to_tree(g_repo, one_sha);
opts.pathspec.count = 1;
opts.pathspec.strings = &onefile;
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);
diff --git a/tests/diff/submodules.c b/tests/diff/submodules.c
index 02870ac86..d46d39934 100644
--- a/tests/diff/submodules.c
+++ b/tests/diff/submodules.c
@@ -417,7 +417,7 @@ void test_diff_submodules__diff_ignore_options(void)
git_diff_free(diff);
opts.ignore_submodules = 0;
- 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_bool(cfg, "diff.ignoreSubmodules", false));
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts));
diff --git a/tests/diff/tree.c b/tests/diff/tree.c
index 6ab49fdb0..9bdb690ab 100644
--- a/tests/diff/tree.c
+++ b/tests/diff/tree.c
@@ -455,7 +455,7 @@ static void set_config_int(git_repository *repo, const char *name, int value)
{
git_config *cfg;
- cl_git_pass(git_repository_config(&cfg, repo));
+ cl_git_pass(git_repository_config_writable(&cfg, repo));
cl_git_pass(git_config_set_int32(cfg, name, value));
git_config_free(cfg);
}
diff --git a/tests/merge/files.c b/tests/merge/files.c
index c377471e2..adf4e02c2 100644
--- a/tests/merge/files.c
+++ b/tests/merge/files.c
@@ -22,7 +22,7 @@ void test_merge_files__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);
}
diff --git a/tests/merge/workdir/analysis.c b/tests/merge/workdir/analysis.c
index 85918abe4..ad62c928f 100644
--- a/tests/merge/workdir/analysis.c
+++ b/tests/merge/workdir/analysis.c
@@ -116,8 +116,8 @@ void test_merge_workdir_analysis__fastforward_with_config_noff(void)
git_merge_analysis_t merge_analysis;
git_merge_preference_t merge_pref;
- git_repository_config(&config, repo);
- git_config_set_string(config, "merge.ff", "false");
+ git_repository_config_writable(&config, repo);
+ cl_git_pass(git_config_set_string(config, "merge.ff", "false"));
analysis_from_branch(&merge_analysis, &merge_pref, FASTFORWARD_BRANCH);
cl_assert_equal_i(GIT_MERGE_ANALYSIS_FASTFORWARD, (merge_analysis & GIT_MERGE_ANALYSIS_FASTFORWARD));
@@ -131,8 +131,8 @@ void test_merge_workdir_analysis__no_fastforward_with_config_ffonly(void)
git_merge_analysis_t merge_analysis;
git_merge_preference_t merge_pref;
- git_repository_config(&config, repo);
- git_config_set_string(config, "merge.ff", "only");
+ git_repository_config_writable(&config, repo);
+ cl_git_pass(git_config_set_string(config, "merge.ff", "only"));
analysis_from_branch(&merge_analysis, &merge_pref, NOFASTFORWARD_BRANCH);
cl_assert_equal_i(GIT_MERGE_ANALYSIS_NORMAL, (merge_analysis & GIT_MERGE_ANALYSIS_NORMAL));
diff --git a/tests/merge/workdir/dirty.c b/tests/merge/workdir/dirty.c
index 776e4ea69..5ffd6bf5d 100644
--- a/tests/merge/workdir/dirty.c
+++ b/tests/merge/workdir/dirty.c
@@ -80,7 +80,7 @@ static void set_core_autocrlf_to(git_repository *repo, bool value)
{
git_config *cfg;
- cl_git_pass(git_repository_config(&cfg, repo));
+ cl_git_pass(git_repository_config_writable(&cfg, repo));
cl_git_pass(git_config_set_bool(cfg, "core.autocrlf", value));
git_config_free(cfg);
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index 807a88f4c..9cee4fee0 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -22,7 +22,7 @@ void test_merge_workdir_renames__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
/* 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);
}
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index 327408dc9..0b5d76f17 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -81,7 +81,7 @@ void test_merge_workdir_simple__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);
}
@@ -115,7 +115,7 @@ static void set_core_autocrlf_to(git_repository *repo, bool value)
{
git_config *cfg;
- cl_git_pass(git_repository_config(&cfg, repo));
+ cl_git_pass(git_repository_config_writable(&cfg, repo));
cl_git_pass(git_config_set_bool(cfg, "core.autocrlf", value));
git_config_free(cfg);
@@ -349,7 +349,7 @@ void test_merge_workdir_simple__diff3_from_config(void)
REMOVED_IN_MASTER_REUC_ENTRY
};
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_set_string(config, "merge.conflictstyle", "diff3"));
merge_simple_branch(0, 0);
@@ -389,7 +389,7 @@ void test_merge_workdir_simple__merge_overrides_config(void)
REMOVED_IN_MASTER_REUC_ENTRY
};
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_set_string(config, "merge.conflictstyle", "diff3"));
merge_simple_branch(0, GIT_CHECKOUT_CONFLICT_STYLE_MERGE);
diff --git a/tests/network/remote/createthenload.c b/tests/network/remote/createthenload.c
index ac6cfccd3..c1e9b0d2c 100644
--- a/tests/network/remote/createthenload.c
+++ b/tests/network/remote/createthenload.c
@@ -11,7 +11,7 @@ void test_network_remote_createthenload__initialize(void)
cl_git_pass(git_repository_open(&_repo, "testrepo.git"));
- cl_git_pass(git_repository_config(&_config, _repo));
+ cl_git_pass(git_repository_config_writable(&_config, _repo));
cl_git_pass(git_config_set_string(_config, "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"));
cl_git_pass(git_config_set_string(_config, "remote.origin.url", url));
git_config_free(_config);
diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c
index 333b52a5b..0a441532d 100644
--- a/tests/network/remote/remotes.c
+++ b/tests/network/remote/remotes.c
@@ -262,7 +262,7 @@ void test_network_remote_remotes__missing_refspecs(void)
git_remote_free(_remote);
_remote = NULL;
- 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, "remote.specless.url", "http://example.com"));
cl_git_pass(git_remote_load(&_remote, _repo, "specless"));
@@ -278,7 +278,7 @@ void test_network_remote_remotes__list(void)
cl_assert(list.count == 5);
git_strarray_free(&list);
- cl_git_pass(git_repository_config(&cfg, _repo));
+ cl_git_pass(git_repository_config_writable(&cfg, _repo));
/* Create a new remote */
cl_git_pass(git_config_set_string(cfg, "remote.specless.url", "http://example.com"));
@@ -380,22 +380,27 @@ void test_network_remote_remotes__tagopt(void)
const char *opt;
git_config *cfg;
- cl_git_pass(git_repository_config(&cfg, _repo));
-
git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL);
cl_git_pass(git_remote_save(_remote));
+
+ cl_git_pass(git_repository_config(&cfg, _repo));
cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt"));
cl_assert_equal_s("--tags", opt);
+ git_config_free(cfg);
git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_NONE);
cl_git_pass(git_remote_save(_remote));
+
+ cl_git_pass(git_repository_config(&cfg, _repo));
cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt"));
cl_assert_equal_s("--no-tags", opt);
+ git_config_free(cfg);
git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO);
cl_git_pass(git_remote_save(_remote));
- cl_assert(git_config_get_string(&opt, cfg, "remote.test.tagopt") == GIT_ENOTFOUND);
+ cl_git_pass(git_repository_config(&cfg, _repo));
+ cl_assert(git_config_get_string(&opt, cfg, "remote.test.tagopt") == GIT_ENOTFOUND);
git_config_free(cfg);
}
diff --git a/tests/notes/notesref.c b/tests/notes/notesref.c
index a33141979..197bad956 100644
--- a/tests/notes/notesref.c
+++ b/tests/notes/notesref.c
@@ -38,7 +38,7 @@ void test_notes_notesref__config_corenotesref(void)
cl_git_pass(git_signature_now(&_sig, "alice", "alice@example.com"));
cl_git_pass(git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479"));
- 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, "core.notesRef", "refs/notes/mydefaultnotesref"));
diff --git a/tests/online/fetchhead.c b/tests/online/fetchhead.c
index 0b3f20db1..c601815b1 100644
--- a/tests/online/fetchhead.c
+++ b/tests/online/fetchhead.c
@@ -82,7 +82,7 @@ void test_online_fetchhead__no_merges(void)
fetchhead_test_clone();
- cl_git_pass(git_repository_config(&config, g_repo));
+ cl_git_pass(git_repository_config_writable(&config, g_repo));
cl_git_pass(git_config_delete_entry(config, "branch.master.remote"));
cl_git_pass(git_config_delete_entry(config, "branch.master.merge"));
git_config_free(config);
diff --git a/tests/refs/branches/create.c b/tests/refs/branches/create.c
index 3a4f33b6e..5efe498f7 100644
--- a/tests/refs/branches/create.c
+++ b/tests/refs/branches/create.c
@@ -120,7 +120,7 @@ void test_refs_branches_create__default_reflog_message(void)
git_signature *sig;
git_config *cfg;
- 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, "user.name", "Foo Bar"));
cl_git_pass(git_config_set_string(cfg, "user.email", "foo@example.com"));
git_config_free(cfg);
diff --git a/tests/refs/branches/move.c b/tests/refs/branches/move.c
index f136b00d6..1cc6c3046 100644
--- a/tests/refs/branches/move.c
+++ b/tests/refs/branches/move.c
@@ -220,7 +220,7 @@ void test_refs_branches_move__default_reflog_message(void)
git_signature *sig;
git_config *cfg;
- 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, "user.name", "Foo Bar"));
cl_git_pass(git_config_set_string(cfg, "user.email", "foo@example.com"));
git_config_free(cfg);
diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c
index ce3569813..b09a1c3fb 100644
--- a/tests/refs/branches/upstream.c
+++ b/tests/refs/branches/upstream.c
@@ -113,26 +113,33 @@ void test_refs_branches_upstream__set_unset_upstream(void)
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));
cl_assert_equal_s(value, "refs/heads/master");
+ git_config_free(config);
git_reference_free(branch);
/* local */
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test"));
cl_git_pass(git_branch_set_upstream(branch, "master"));
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_pass(git_config_get_string(&value, config, "branch.test.remote"));
cl_assert_equal_s(value, ".");
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));
cl_assert_equal_s(value, "refs/heads/master");
+ git_config_free(config);
/* unset */
cl_git_pass(git_branch_set_upstream(branch, NULL));
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_fail_with(git_config_get_string(&value, config, "branch.test.merge"), GIT_ENOTFOUND);
cl_git_fail_with(git_config_get_string(&value, config, "branch.test.remote"), GIT_ENOTFOUND);
+ git_config_free(config);
git_reference_free(branch);
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/master"));
cl_git_pass(git_branch_set_upstream(branch, NULL));
+
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_fail_with(git_config_get_string(&value, config, "branch.master.merge"), GIT_ENOTFOUND);
cl_git_fail_with(git_config_get_string(&value, config, "branch.master.remote"), GIT_ENOTFOUND);
diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c
index 792b0f05d..8b2ff535a 100644
--- a/tests/refs/reflog/reflog.c
+++ b/tests/refs/reflog/reflog.c
@@ -302,7 +302,7 @@ void test_refs_reflog_reflog__logallrefupdates_bare_set_false(void)
{
git_config *config;
- cl_git_pass(git_repository_config(&config, g_repo));
+ cl_git_pass(git_repository_config_writable(&config, g_repo));
cl_git_pass(git_config_set_bool(config, "core.logallrefupdates", false));
git_config_free(config);
@@ -313,7 +313,7 @@ void test_refs_reflog_reflog__logallrefupdates_bare_unset(void)
{
git_config *config;
- cl_git_pass(git_repository_config(&config, g_repo));
+ cl_git_pass(git_repository_config_writable(&config, g_repo));
cl_git_pass(git_config_delete_entry(config, "core.logallrefupdates"));
git_config_free(config);
@@ -328,7 +328,7 @@ void test_refs_reflog_reflog__logallrefupdates_nonbare_set_false(void)
g_repo = cl_git_sandbox_init("testrepo");
- cl_git_pass(git_repository_config(&config, g_repo));
+ cl_git_pass(git_repository_config_writable(&config, g_repo));
cl_git_pass(git_config_set_bool(config, "core.logallrefupdates", false));
git_config_free(config);
diff --git a/tests/repo/config.c b/tests/repo/config.c
index 93dedd576..49d52f0ce 100644
--- a/tests/repo/config.c
+++ b/tests/repo/config.c
@@ -44,7 +44,7 @@ void test_repo_config__can_open_global_when_there_is_no_file(void)
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr));
cl_git_pass(git_repository_open(&repo, "empty_standard_repo"));
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_open_level(
&global, config, GIT_CONFIG_LEVEL_GLOBAL));
@@ -73,7 +73,7 @@ void test_repo_config__can_open_missing_global_with_separators(void)
git_buf_free(&path);
cl_git_pass(git_repository_open(&repo, "empty_standard_repo"));
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_open_level(
&global, config, GIT_CONFIG_LEVEL_GLOBAL));
diff --git a/tests/repo/init.c b/tests/repo/init.c
index aea383c64..92c0ca986 100644
--- a/tests/repo/init.c
+++ b/tests/repo/init.c
@@ -138,7 +138,7 @@ void test_repo_init__reinit_too_recent_bare_repo(void)
/* Initialize the repository */
cl_git_pass(git_repository_init(&_repo, "reinit.git", 1));
- git_repository_config(&config, _repo);
+ git_repository_config_writable(&config, _repo);
/*
* Hack the config of the repository to make it look like it has
@@ -257,8 +257,8 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
cl_git_pass(git_repository_init(&_repo, "not.overwrite.git", 1));
/* Change the "core.ignorecase" config value to something unlikely */
- git_repository_config(&config, _repo);
- git_config_set_int32(config, "core.ignorecase", 42);
+ cl_git_pass(git_repository_config_writable(&config, _repo));
+ cl_git_pass(git_config_set_int32(config, "core.ignorecase", 42));
git_config_free(config);
git_repository_free(_repo);
_repo = NULL;
@@ -576,7 +576,7 @@ void test_repo_init__init_with_initial_commit(void)
/* Make sure we're ready to use git_signature_default :-) */
{
git_config *cfg, *local;
- cl_git_pass(git_repository_config(&cfg, _repo));
+ cl_git_pass(git_repository_config_writable(&cfg, _repo));
cl_git_pass(git_config_open_level(&local, cfg, GIT_CONFIG_LEVEL_LOCAL));
cl_git_pass(git_config_set_string(local, "user.name", "Test User"));
cl_git_pass(git_config_set_string(local, "user.email", "t@example.com"));
diff --git a/tests/repo/open.c b/tests/repo/open.c
index 637c785d5..b11bbf42f 100644
--- a/tests/repo/open.c
+++ b/tests/repo/open.c
@@ -318,7 +318,7 @@ void test_repo_open__no_config(void)
git_buf_free(&path);
cl_git_pass(git_repository_open(&repo, "empty_standard_repo"));
- cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_repository_config_writable(&config, repo));
cl_git_pass(git_config_set_string(config, "test.set", "42"));
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"));
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index a4e766fdf..1102a0ec3 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -388,7 +388,7 @@ void test_status_ignore__leading_slash_ignores(void)
cl_git_mkfile("home/.gitignore", "/ignore_me\n");
{
git_config *cfg;
- 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, "core.excludesfile", "~/.gitignore"));
git_config_free(cfg);
diff --git a/tests/submodule/modify.c b/tests/submodule/modify.c
index 582d4166b..c809e45e7 100644
--- a/tests/submodule/modify.c
+++ b/tests/submodule/modify.c
@@ -33,7 +33,7 @@ void test_submodule_modify__init(void)
const char *str;
/* erase submodule data from .git/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_foreach_match(cfg, "submodule\\..*", delete_one_config, cfg));
git_config_free(cfg);