summaryrefslogtreecommitdiff
path: root/tests/checkout/nasty.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-12-16 18:53:55 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2014-12-17 12:52:07 -0500
commitec74b40ceef3dc3892c7d84bb4f5d99bab504ba4 (patch)
treea33dbb62e0f08e14730557695bd911037079c0af /tests/checkout/nasty.c
parent8e35527de25ac156f3600e2ce49b0c3483c258c4 (diff)
downloadlibgit2-ec74b40ceef3dc3892c7d84bb4f5d99bab504ba4.tar.gz
Introduce core.protectHFS and core.protectNTFS
Validate HFS ignored char ".git" paths when `core.protectHFS` is specified. Validate NTFS invalid ".git" paths when `core.protectNTFS` is specified.
Diffstat (limited to 'tests/checkout/nasty.c')
-rw-r--r--tests/checkout/nasty.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/checkout/nasty.c b/tests/checkout/nasty.c
index a667dcd8f..c07d9382a 100644
--- a/tests/checkout/nasty.c
+++ b/tests/checkout/nasty.c
@@ -291,3 +291,35 @@ void test_checkout_nasty__dot_git_hfs_ignorable(void)
test_checkout_fails("refs/heads/dotgit_hfs_ignorable_16", ".git/foobar");
#endif
}
+
+void test_checkout_nasty__honors_core_protecthfs(void)
+{
+ cl_repo_set_bool(repo, "core.protectHFS", true);
+
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_1", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_2", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_3", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_4", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_5", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_6", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_7", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_8", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_9", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_10", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_11", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_12", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_13", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_14", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_15", ".git/foobar");
+ test_checkout_fails("refs/heads/dotgit_hfs_ignorable_16", ".git/foobar");
+}
+
+void test_checkout_nasty__honors_core_protectntfs(void)
+{
+ cl_repo_set_bool(repo, "core.protectNTFS", true);
+
+ test_checkout_fails("refs/heads/dotgit_backslash_path", ".git/foobar");
+ test_checkout_fails("refs/heads/dotcapitalgit_backslash_path", ".GIT/foobar");
+ test_checkout_fails("refs/heads/dot_git_dot", ".git/foobar");
+ test_checkout_fails("refs/heads/git_tilde1", ".git/foobar");
+}