Prevent user's merge.conflictstyle from breaking tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index a8b93b2..2fea511 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -61,12 +61,19 @@ struct checkout_name_entry {
void test_checkout_conflict__initialize(void)
{
+ git_config *cfg;
+
g_repo = cl_git_sandbox_init(TEST_REPO_PATH);
git_repository_index(&g_index, g_repo);
cl_git_rewritefile(
TEST_REPO_PATH "/.gitattributes",
"* 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_config_set_string(cfg, "merge.conflictstyle", "merge"));
+ git_config_free(cfg);
}
void test_checkout_conflict__cleanup(void)
diff --git a/tests/merge/workdir/renames.c b/tests/merge/workdir/renames.c
index d383979..2774772 100644
--- a/tests/merge/workdir/renames.c
+++ b/tests/merge/workdir/renames.c
@@ -17,7 +17,14 @@ static git_repository *repo;
// Fixture setup and teardown
void test_merge_workdir_renames__initialize(void)
{
+ git_config *cfg;
+
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_config_set_string(cfg, "merge.conflictstyle", "merge"));
+ git_config_free(cfg);
}
void test_merge_workdir_renames__cleanup(void)
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index 1f12887..a9a6365 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -116,8 +116,15 @@ static git_index *repo_index;
// Fixture setup and teardown
void test_merge_workdir_simple__initialize(void)
{
+ git_config *cfg;
+
repo = cl_git_sandbox_init(TEST_REPO_PATH);
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_config_set_string(cfg, "merge.conflictstyle", "merge"));
+ git_config_free(cfg);
}
void test_merge_workdir_simple__cleanup(void)