summaryrefslogtreecommitdiff
path: root/tests/index/tests.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-12-03 19:50:18 +1100
committerEdward Thomson <ethomson@edwardthomson.com>2019-12-10 18:11:45 +1000
commit85d4ff77e2b539c525f36d0860f3faa8e68308b7 (patch)
treeacd2066e1d951a8ce54ae4d47706ef154c74ced6 /tests/index/tests.c
parentba4c769b13d646664d7db8589e605f5923614347 (diff)
downloadlibgit2-85d4ff77e2b539c525f36d0860f3faa8e68308b7.tar.gz
index: ensure that we respect core.protectNTFS=false
Users may want to turn off core.protectNTFS, perhaps to import (and then repair) a broken tree. Ensure that core.protectNTFS=false is honored.
Diffstat (limited to 'tests/index/tests.c')
-rw-r--r--tests/index/tests.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/index/tests.c b/tests/index/tests.c
index c793b44f1..4c9deaaba 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -780,6 +780,26 @@ void test_index_tests__protectntfs_on_by_default(void)
cl_fixture_cleanup("invalid");
}
+void test_index_tests__can_disable_protectntfs(void)
+{
+ git_repository *repo;
+ git_index *index;
+
+ cl_must_pass(p_mkdir("valid", 0700));
+ cl_git_rewritefile("valid/git~1", "steal the shortname");
+
+ cl_git_pass(git_repository_init(&repo, "./valid", 0));
+ cl_git_pass(git_repository_index(&index, repo));
+ cl_repo_set_bool(repo, "core.protectNTFS", false);
+
+ cl_git_pass(git_index_add_bypath(index, "git~1"));
+
+ git_index_free(index);
+ git_repository_free(repo);
+
+ cl_fixture_cleanup("valid");
+}
+
void test_index_tests__remove_entry(void)
{
git_repository *repo;