Commit d853fb9f by Edward Thomson Committed by Edward Thomson

Always checkout with case sensitive iterator

On a case-insensitive filesystem, we need to deal with case-changing
renames (eg, foo -> FOO) by removing the old and adding the new,
exactly as if we were on a case-sensitive filesystem.

Update the `checkout::tree::can_cancel_checkout_from_notify` test, now
that notifications are always sent case sensitively.
parent 84330788
...@@ -2364,7 +2364,7 @@ int git_checkout_tree( ...@@ -2364,7 +2364,7 @@ int git_checkout_tree(
} }
} }
if (!(error = git_iterator_for_tree(&tree_i, tree, 0, NULL, NULL))) if (!(error = git_iterator_for_tree(&tree_i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)))
error = git_checkout_iterator(tree_i, opts); error = git_checkout_iterator(tree_i, opts);
git_iterator_free(tree_i); git_iterator_free(tree_i);
......
...@@ -645,13 +645,6 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void) ...@@ -645,13 +645,6 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void)
cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), -5555); cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), -5555);
cl_assert(!git_path_exists("testrepo/new.txt")); cl_assert(!git_path_exists("testrepo/new.txt"));
/* on case-insensitive FS = a/b.txt, branch_file.txt, new.txt */
/* on case-sensitive FS = README, then above */
if (git_path_exists("testrepo/.git/CoNfIg")) /* case insensitive */
cl_assert_equal_i(3, ca.count);
else
cl_assert_equal_i(4, ca.count); cl_assert_equal_i(4, ca.count);
/* and again with a different stopping point and return code */ /* and again with a different stopping point and return code */
...@@ -662,10 +655,6 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void) ...@@ -662,10 +655,6 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void)
cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), 123); cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), 123);
cl_assert(!git_path_exists("testrepo/new.txt")); cl_assert(!git_path_exists("testrepo/new.txt"));
if (git_path_exists("testrepo/.git/CoNfIg")) /* case insensitive */
cl_assert_equal_i(4, ca.count);
else
cl_assert_equal_i(1, ca.count); cl_assert_equal_i(1, ca.count);
git_object_free(obj); git_object_free(obj);
......
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