Commit 97fb9ac7 by Edward Thomson

attr: test that a file is not ignored for a folder

When a .gitignore specifies some folder "foo/", ensure that a file
with the same name "foo" is not ignored.
parent adad5181
......@@ -223,3 +223,20 @@ void test_attr_ignore__gitignore_in_subdir(void)
}
}
void test_attr_ignore__depth_file_not_ignored_when_folder_specified(void)
{
cl_git_rmfile("attr/.gitignore");
cl_must_pass(p_mkdir("attr/dir1", 0777));
cl_must_pass(p_mkdir("attr/dir1/dir2", 0777));
cl_must_pass(p_mkdir("attr/dir1/dir2/dir3", 0777));
cl_git_mkfile("attr/dir1/dir2/dir3/.gitignore", "dir1/\n");
assert_is_ignored(false, "dir1/dir2/dir3/dir1");
if (cl_repo_get_bool(g_repo, "core.ignorecase")) {
assert_is_ignored(false, "dir1/dir2/dir3/DiR1");
}
}
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