Commit 2f089539 by Russell Belfer

Actually fix win32 checkout test

It turns out that using REMOVE_UNTRACKED with checkout for this
particular test was causing the .gitattributes file to be removed
and so we do have to allow for the CRs in the created file...
parent bebdbcd4
...@@ -470,6 +470,10 @@ void test_checkout_index__can_update_prefixed_files(void) ...@@ -470,6 +470,10 @@ void test_checkout_index__can_update_prefixed_files(void)
{ {
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
cl_assert_equal_i(false, git_path_isfile("./testrepo/README"));
cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt"));
cl_assert_equal_i(false, git_path_isfile("./testrepo/new.txt"));
cl_git_mkfile("./testrepo/READ", "content\n"); cl_git_mkfile("./testrepo/READ", "content\n");
cl_git_mkfile("./testrepo/README.after", "content\n"); cl_git_mkfile("./testrepo/README.after", "content\n");
cl_git_pass(p_mkdir("./testrepo/branch_file", 0777)); cl_git_pass(p_mkdir("./testrepo/branch_file", 0777));
...@@ -477,13 +481,17 @@ void test_checkout_index__can_update_prefixed_files(void) ...@@ -477,13 +481,17 @@ void test_checkout_index__can_update_prefixed_files(void)
cl_git_mkfile("./testrepo/branch_file/contained_file", "content\n"); cl_git_mkfile("./testrepo/branch_file/contained_file", "content\n");
cl_git_pass(p_mkdir("./testrepo/branch_file.txt.after", 0777)); cl_git_pass(p_mkdir("./testrepo/branch_file.txt.after", 0777));
opts.checkout_strategy = GIT_CHECKOUT_FORCE | GIT_CHECKOUT_REMOVE_UNTRACKED; opts.checkout_strategy =
GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_REMOVE_UNTRACKED;
cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); cl_git_pass(git_checkout_index(g_repo, NULL, &opts));
test_file_contents("./testrepo/README", "hey there\n"); /* remove untracked will remove the .gitattributes file before the blobs
test_file_contents("./testrepo/branch_file.txt", "hi\nbye!\n"); * were created, so they will have had crlf filtering applied on Windows
test_file_contents("./testrepo/new.txt", "my new file\n"); */
test_file_contents_nocr("./testrepo/README", "hey there\n");
test_file_contents_nocr("./testrepo/branch_file.txt", "hi\nbye!\n");
test_file_contents_nocr("./testrepo/new.txt", "my new file\n");
cl_assert(!git_path_exists("testrepo/READ")); cl_assert(!git_path_exists("testrepo/READ"));
cl_assert(!git_path_exists("testrepo/README.after")); cl_assert(!git_path_exists("testrepo/README.after"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment