Commit 3520c97057a2e4236779d24ec6fece0d11514319

Edward Thomson 2015-03-27T15:39:28

Revert "Always checkout with case sensitive iterator" This reverts commit 40d791545abfb3cb71553a27dc64129e1a9bec28.

diff --git a/src/checkout.c b/src/checkout.c
index 4781308..b70ea18 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -2643,7 +2643,7 @@ int git_checkout_tree(
 	if ((error = git_repository_index(&index, repo)) < 0)
 		return error;
 
-	if (!(error = git_iterator_for_tree(&tree_i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)))
+	if (!(error = git_iterator_for_tree(&tree_i, tree, 0, NULL, NULL)))
 		error = git_checkout_iterator(tree_i, index, opts);
 
 	git_iterator_free(tree_i);
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index 7b0eae4..3bc9c93 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -646,7 +646,14 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void)
 	cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), -5555);
 
 	cl_assert(!git_path_exists("testrepo/new.txt"));
-	cl_assert_equal_i(4, ca.count);
+
+	/* 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);
 
 	/* and again with a different stopping point and return code */
 	ca.filename = "README";
@@ -656,7 +663,11 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void)
 	cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), 123);
 
 	cl_assert(!git_path_exists("testrepo/new.txt"));
-	cl_assert_equal_i(1, ca.count);
+
+	if (git_path_exists("testrepo/.git/CoNfIg")) /* case insensitive */
+		cl_assert_equal_i(4, ca.count);
+	else
+		cl_assert_equal_i(1, ca.count);
 
 	git_object_free(obj);
 }