Merge pull request #7153 from ambv/fix-iterator-index-case-folding-test-docker

This commit is contained in:
Edward Thomson
2025-12-06 21:54:41 +00:00
committed by GitHub

View File

@@ -280,12 +280,24 @@ static const char *expected_index_ci[] = {
void test_iterator_index__case_folding(void)
{
git_str path = GIT_STR_INIT;
git_index *index;
int fs_is_ci = 0;
int index_is_ci = 0;
cl_git_pass(git_str_joinpath(&path, cl_fixture("icase"), ".gitted/CoNfIg"));
g_repo = cl_git_sandbox_init("icase");
/* check filesystem case-sensitivity in the sandbox where tests will be executing */
cl_git_pass(git_str_joinpath(&path, git_repository_workdir(g_repo), ".git/CoNfIg"));
fs_is_ci = git_fs_path_exists(path.ptr);
git_str_dispose(&path);
/* verify index capability matches filesystem detection */
cl_git_pass(git_repository_index(&index, g_repo));
index_is_ci = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
cl_assert_equal_i(fs_is_ci, index_is_ci);
git_index_free(index);
cl_git_sandbox_cleanup();
index_iterator_test(
"icase", NULL, NULL, 0, ARRAY_SIZE(expected_index_cs),
fs_is_ci ? expected_index_ci : expected_index_cs, NULL);