Commit 336991db by Edward Thomson

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 a3cbd204
......@@ -616,6 +616,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);
......@@ -627,6 +628,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));
......@@ -700,6 +702,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