Skip to content

Commit e476e7b

Browse files
Edward Thomsonethomson
authored andcommitted
index tests: test capitalization before mkdir
1 parent 90fad07 commit e476e7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/index/tests.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ void test_index_tests__add_invalid_filename(void)
340340
cl_must_pass(p_mkdir("./invalid/subdir", 0777));
341341

342342
/* cl_git_mkfile() needs the dir to exist */
343-
cl_must_pass(p_mkdir("./invalid/.GIT", 0777));
344-
cl_must_pass(p_mkdir("./invalid/.GiT", 0777));
343+
if (!git_path_exists("./invalid/.GIT"))
344+
cl_must_pass(p_mkdir("./invalid/.GIT", 0777));
345+
if (!git_path_exists("./invalid/.GiT"))
346+
cl_must_pass(p_mkdir("./invalid/.GiT", 0777));
345347

346348
add_invalid_filename(repo, ".git/hello");
347349
add_invalid_filename(repo, ".GIT/hello");

0 commit comments

Comments
 (0)