Skip to content

Commit a145f2b

Browse files
committed
checkout: add a failing test for refusing a symlinked .gitmodules
We want to reject these as they cause compatibility issues and can lead to git writing to files outside of the repository.
1 parent 490cbaa commit a145f2b

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

tests/checkout/nasty.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,10 @@ void test_checkout_nasty__symlink3(void)
364364
test_checkout_passes("refs/heads/symlink3", ".git/foobar");
365365
}
366366

367+
void test_checkout_nasty__gitmodules_symlink(void)
368+
{
369+
cl_repo_set_bool(repo, "core.protectHFS", true);
370+
cl_repo_set_bool(repo, "core.protectNTFS", true);
371+
372+
test_checkout_passes("refs/heads/gitmodules-symlink", ".gitmodules");
373+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e30b60b120761f44ebd0f0a7b0e9445ce8e11d68

0 commit comments

Comments
 (0)