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.
This commit is contained in:
Carlos Martín Nieto
2018-05-22 14:16:45 +02:00
parent 490cbaa97b
commit a145f2b642
6 changed files with 8 additions and 0 deletions

View File

@@ -364,3 +364,10 @@ void test_checkout_nasty__symlink3(void)
test_checkout_passes("refs/heads/symlink3", ".git/foobar");
}
void test_checkout_nasty__gitmodules_symlink(void)
{
cl_repo_set_bool(repo, "core.protectHFS", true);
cl_repo_set_bool(repo, "core.protectNTFS", true);
test_checkout_passes("refs/heads/gitmodules-symlink", ".gitmodules");
}

View File

@@ -0,0 +1 @@
e30b60b120761f44ebd0f0a7b0e9445ce8e11d68