Skip to content

Commit bc74c53

Browse files
committed
Implement failing test for gitignore of complex subdirectory negation
When a directory's contents are ignored, and then a glob negation is made to a nested subdir, other subdirectories are now unignored
1 parent 8e4927a commit bc74c53

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/status/ignore.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,3 +1213,21 @@ void test_status_ignore__unignored_subdirs(void)
12131213
assert_is_ignored("dir/a.test");
12141214
refute_is_ignored("dir/subdir/a.test");
12151215
}
1216+
1217+
void test_status_ignore__ignored_subdirfiles_with_subdir_rule(void)
1218+
{
1219+
static const char *test_files[] = {
1220+
"empty_standard_repo/dir/a.test",
1221+
"empty_standard_repo/dir/sub1/b.test",
1222+
NULL
1223+
};
1224+
1225+
make_test_data("empty_standard_repo", test_files);
1226+
cl_git_mkfile(
1227+
"empty_standard_repo/.gitignore",
1228+
"/dir/*\n"
1229+
"!/dir/sub1/sub2/**/*\n");
1230+
1231+
assert_is_ignored("dir/a.test");
1232+
assert_is_ignored("dir/sub1/a.test");
1233+
}

0 commit comments

Comments
 (0)