diff options
author | Tyler Ang-Wanek <tylerw@axosoft.com> | 2019-03-14 09:59:27 -0700 |
---|---|---|
committer | Tyler Ang-Wanek <tylerw@axosoft.com> | 2019-03-14 13:06:33 -0700 |
commit | bc74c53a3776c69bc01208e43af1613e0401f94a (patch) | |
tree | 3ae86867752561dbb429dd52c65ca94561d9164c | |
parent | 8e4927a44b29e26afa2cbbd410b7a804e4c182e7 (diff) | |
download | libgit2-bc74c53a3776c69bc01208e43af1613e0401f94a.tar.gz |
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
-rw-r--r-- | tests/status/ignore.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/status/ignore.c b/tests/status/ignore.c index 496582136..f6c72c243 100644 --- a/tests/status/ignore.c +++ b/tests/status/ignore.c @@ -1213,3 +1213,21 @@ void test_status_ignore__unignored_subdirs(void) assert_is_ignored("dir/a.test"); refute_is_ignored("dir/subdir/a.test"); } + +void test_status_ignore__ignored_subdirfiles_with_subdir_rule(void) +{ + static const char *test_files[] = { + "empty_standard_repo/dir/a.test", + "empty_standard_repo/dir/sub1/b.test", + NULL + }; + + make_test_data("empty_standard_repo", test_files); + cl_git_mkfile( + "empty_standard_repo/.gitignore", + "/dir/*\n" + "!/dir/sub1/sub2/**/*\n"); + + assert_is_ignored("dir/a.test"); + assert_is_ignored("dir/sub1/a.test"); +} |