Skip to content

Commit 610dcaa

Browse files
authored
Merge pull request libgit2#7153 from ambv/fix-iterator-index-case-folding-test-docker
2 parents ce05246 + 269427b commit 610dcaa

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/libgit2/iterator/index.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,24 @@ static const char *expected_index_ci[] = {
280280
void test_iterator_index__case_folding(void)
281281
{
282282
git_str path = GIT_STR_INIT;
283+
git_index *index;
283284
int fs_is_ci = 0;
285+
int index_is_ci = 0;
286+
287+
g_repo = cl_git_sandbox_init("icase");
284288

285-
cl_git_pass(git_str_joinpath(&path, cl_fixture("icase"), ".gitted/CoNfIg"));
289+
/* check filesystem case-sensitivity in the sandbox where tests will be executing */
290+
cl_git_pass(git_str_joinpath(&path, git_repository_workdir(g_repo), ".git/CoNfIg"));
286291
fs_is_ci = git_fs_path_exists(path.ptr);
287292
git_str_dispose(&path);
288293

294+
/* verify index capability matches filesystem detection */
295+
cl_git_pass(git_repository_index(&index, g_repo));
296+
index_is_ci = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
297+
cl_assert_equal_i(fs_is_ci, index_is_ci);
298+
git_index_free(index);
299+
cl_git_sandbox_cleanup();
300+
289301
index_iterator_test(
290302
"icase", NULL, NULL, 0, ARRAY_SIZE(expected_index_cs),
291303
fs_is_ci ? expected_index_ci : expected_index_cs, NULL);

0 commit comments

Comments
 (0)