diff options
author | Vicent Martà <vicent@github.com> | 2013-06-24 12:02:43 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-06-24 12:02:43 -0700 |
commit | 12212258ec0e1ac663122654868d75ba97d32c7f (patch) | |
tree | 1326ac5133e9e0d026652c6bafda567bc91fa0bc | |
parent | 353a90bedb6e679306f740fd0c1a08fc7934fbaa (diff) | |
parent | f3f4c6b5bea91351a7bdb1d94e76924e76d0fcee (diff) | |
download | libgit2-12212258ec0e1ac663122654868d75ba97d32c7f.tar.gz |
Merge pull request #1674 from arrbee/fix-checkout-target-dir-win32
Fix checkout tests on Windows
-rw-r--r-- | tests-clar/checkout/index.c | 11 | ||||
-rw-r--r-- | tests-clar/checkout/tree.c | 9 |
2 files changed, 14 insertions, 6 deletions
diff --git a/tests-clar/checkout/index.c b/tests-clar/checkout/index.c index c7500db1d..9d8b321ae 100644 --- a/tests-clar/checkout/index.c +++ b/tests-clar/checkout/index.c @@ -26,6 +26,10 @@ void test_checkout_index__initialize(void) void test_checkout_index__cleanup(void) { cl_git_sandbox_cleanup(); + + /* try to remove alternative dir */ + if (git_path_isdir("alternative")) + git_futils_rmdir_r("alternative", NULL, GIT_RMDIR_REMOVE_FILES); } void test_checkout_index__cannot_checkout_a_bare_repository(void) @@ -576,9 +580,10 @@ void test_checkout_index__target_directory_from_bare(void) cl_assert_equal_i(0, cts.n_ignored); cl_assert_equal_i(3, cts.n_updates); - check_file_contents("./alternative/README", "hey there\n"); - check_file_contents("./alternative/branch_file.txt", "hi\nbye!\n"); - check_file_contents("./alternative/new.txt", "my new file\n"); + /* files will have been filtered if needed, so strip CR */ + check_file_contents_nocr("./alternative/README", "hey there\n"); + check_file_contents_nocr("./alternative/branch_file.txt", "hi\nbye!\n"); + check_file_contents_nocr("./alternative/new.txt", "my new file\n"); cl_git_pass(git_futils_rmdir_r( "alternative", NULL, GIT_RMDIR_REMOVE_FILES)); diff --git a/tests-clar/checkout/tree.c b/tests-clar/checkout/tree.c index 0e65f28c8..e4bfbce06 100644 --- a/tests-clar/checkout/tree.c +++ b/tests-clar/checkout/tree.c @@ -24,6 +24,9 @@ void test_checkout_tree__cleanup(void) g_object = NULL; cl_git_sandbox_cleanup(); + + if (git_path_isdir("alternative")) + git_futils_rmdir_r("alternative", NULL, GIT_RMDIR_REMOVE_FILES); } void test_checkout_tree__cannot_checkout_a_non_treeish(void) @@ -667,9 +670,9 @@ void test_checkout_tree__target_directory_from_bare(void) cl_assert_equal_i(0, cts.n_ignored); cl_assert_equal_i(3, cts.n_updates); - check_file_contents("./alternative/README", "hey there\n"); - check_file_contents("./alternative/branch_file.txt", "hi\nbye!\n"); - check_file_contents("./alternative/new.txt", "my new file\n"); + check_file_contents_nocr("./alternative/README", "hey there\n"); + check_file_contents_nocr("./alternative/branch_file.txt", "hi\nbye!\n"); + check_file_contents_nocr("./alternative/new.txt", "my new file\n"); cl_git_pass(git_futils_rmdir_r( "alternative", NULL, GIT_RMDIR_REMOVE_FILES)); |