Merge pull request #2751 from linquize/broken-test-win Fix broken tests on Windows
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index df531f4..4019e00 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -237,6 +237,8 @@ void test_merge_workdir_simple__mergefile(void)
REMOVED_IN_MASTER_REUC_ENTRY
};
+ set_core_autocrlf_to(repo, false);
+
merge_simple_branch(0, 0);
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
@@ -279,6 +281,8 @@ void test_merge_workdir_simple__diff3(void)
REMOVED_IN_MASTER_REUC_ENTRY
};
+ set_core_autocrlf_to(repo, false);
+
merge_simple_branch(0, GIT_CHECKOUT_CONFLICT_STYLE_DIFF3);
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
@@ -352,6 +356,8 @@ void test_merge_workdir_simple__diff3_from_config(void)
cl_git_pass(git_repository_config(&config, repo));
cl_git_pass(git_config_set_string(config, "merge.conflictstyle", "diff3"));
+ set_core_autocrlf_to(repo, false);
+
merge_simple_branch(0, 0);
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
@@ -392,6 +398,8 @@ void test_merge_workdir_simple__merge_overrides_config(void)
cl_git_pass(git_repository_config(&config, repo));
cl_git_pass(git_config_set_string(config, "merge.conflictstyle", "diff3"));
+ set_core_autocrlf_to(repo, false);
+
merge_simple_branch(0, GIT_CHECKOUT_CONFLICT_STYLE_MERGE);
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
diff --git a/tests/network/remote/local.c b/tests/network/remote/local.c
index 1132d95..170d67e 100644
--- a/tests/network/remote/local.c
+++ b/tests/network/remote/local.c
@@ -494,9 +494,8 @@ void test_network_remote_local__push_delete(void)
cl_git_pass(git_remote_push(remote, &specs, NULL, NULL, NULL));
cl_git_fail(git_reference_lookup(&ref, dst_repo, "refs/heads/master"));
- cl_fixture_cleanup("target.git");
-
git_remote_free(remote);
git_repository_free(dst_repo);
- git_repository_free(src_repo);
+ cl_fixture_cleanup("target.git");
+ cl_git_sandbox_cleanup();
}
diff --git a/tests/rebase/merge.c b/tests/rebase/merge.c
index 0617771..1b2ec96 100644
--- a/tests/rebase/merge.c
+++ b/tests/rebase/merge.c
@@ -8,12 +8,24 @@
static git_repository *repo;
static git_signature *signature;
+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_config_set_bool(cfg, "core.autocrlf", value));
+
+ git_config_free(cfg);
+}
+
// Fixture setup and teardown
void test_rebase_merge__initialize(void)
{
repo = cl_git_sandbox_init("rebase");
cl_git_pass(git_signature_new(&signature,
"Rebaser", "rebaser@rebaser.rb", 1405694510, 0));
+
+ set_core_autocrlf_to(repo, false);
}
void test_rebase_merge__cleanup(void)