Commit ee3dbe12 by Edward Thomson Committed by Patrick Steinhardt

test: ensure index adds validate new protection rules

Ensure that the new protection around .git::$INDEX_ALLOCATION rules are
enabled for adding to the index when core.protectNTFS is set.
parent ba6e2bfb
......@@ -527,6 +527,7 @@ static void assert_write_fails(git_repository *repo, const char *fn_orig)
*/
fn = git__strdup(fn_orig);
replace_char(fn, '/', '_');
replace_char(fn, ':', '!');
git_buf_joinpath(&path, "./invalid", fn);
......@@ -538,6 +539,7 @@ static void assert_write_fails(git_repository *repo, const char *fn_orig)
/* kids, don't try this at home */
replace_char((char *)entry->path, '_', '/');
replace_char((char *)entry->path, '!', ':');
/* write-tree */
cl_git_fail(git_index_write_tree(&expected, index));
......@@ -587,6 +589,7 @@ void test_index_tests__honors_protect_filesystems(void)
assert_write_fails(repo, ".git\xe2\x80\xad/hello");
assert_write_fails(repo, "git~1/hello");
assert_write_fails(repo, ".git\xe2\x81\xaf/hello");
assert_write_fails(repo, ".git::$INDEX_ALLOCATION/dummy-file");
git_repository_free(repo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment