Prevent user's merge.conflictstyle from breaking tests

This commit is contained in:
Ben Straub 2014-02-05 13:35:26 -08:00
parent 5c8be32559
commit a2ce19ca68
3 changed files with 21 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)