]> git.proxmox.com Git - libgit2.git/commitdiff
Fix checkout tests on Windows
authorRussell Belfer <rb@github.com>
Mon, 24 Jun 2013 18:56:35 +0000 (11:56 -0700)
committerRussell Belfer <rb@github.com>
Mon, 24 Jun 2013 18:56:35 +0000 (11:56 -0700)
tests-clar/checkout/index.c
tests-clar/checkout/tree.c

index c7500db1d3e16d1005cbc8a5979d27caaff2c58c..9d8b321ae0add9b2cca501401c841285faa3d10e 100644 (file)
@@ -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));
index 0e65f28c870163a41cf34becf20de6c048bcaf91..e4bfbce060c75e14d311681d6b0b12c3d794023b 100644 (file)
@@ -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));