summaryrefslogtreecommitdiff
path: root/tests/path/core.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-12-16 18:53:55 -0600
committerEdward Thomson <ethomson@microsoft.com>2014-12-17 15:00:20 -0600
commit91fa31fb6f44919d5dcbaa157cfac9fb49dc44df (patch)
treec4e45bd3bb838e9aad31a12121d315faf8d90bd2 /tests/path/core.c
parent0183c4d2590163f1ac2d813d84c33bdf1bb01f68 (diff)
downloadlibgit2-hf/libgit2sharp_020_patch.tar.gz
Introduce core.protectHFS and core.protectNTFShf/libgit2sharp_020_patch
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/path/core.c')
-rw-r--r--tests/path/core.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/path/core.c b/tests/path/core.c
index 528108bea..85fee820a 100644
--- a/tests/path/core.c
+++ b/tests/path/core.c
@@ -172,11 +172,27 @@ void test_path_core__isvalid_trailing_colon(void)
cl_assert_equal_b(false, git_path_isvalid(NULL, "foo:/bar", GIT_PATH_REJECT_TRAILING_COLON));
}
-void test_path_core__isvalid_dos_git_shortname(void)
+void test_path_core__isvalid_dotgit_ntfs(void)
{
- cl_assert_equal_b(true, git_path_isvalid(NULL, "git~1", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, ".git", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, ".git ", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, ".git.", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, ".git.. .", 0));
- cl_assert_equal_b(false, git_path_isvalid(NULL, "git~1", GIT_PATH_REJECT_DOS_GIT_SHORTNAME));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, "git~1", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, "git~1 ", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, "git~1.", 0));
+ cl_assert_equal_b(true, git_path_isvalid(NULL, "git~1.. .", 0));
+
+ cl_assert_equal_b(false, git_path_isvalid(NULL, ".git", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, ".git ", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, ".git.", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, ".git.. .", GIT_PATH_REJECT_DOT_GIT_NTFS));
+
+ cl_assert_equal_b(false, git_path_isvalid(NULL, "git~1", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, "git~1 ", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, "git~1.", GIT_PATH_REJECT_DOT_GIT_NTFS));
+ cl_assert_equal_b(false, git_path_isvalid(NULL, "git~1.. .", GIT_PATH_REJECT_DOT_GIT_NTFS));
}
void test_path_core__isvalid_dos_paths(void)