diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-06-15 15:47:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 15:47:41 +0100 |
commit | fef847ae57d74e93563bc04222d9da7007fffc4f (patch) | |
tree | 30e23c0b5b069f04c024e86fc9c1934ad2aaf04a /tests/ignore/path.c | |
parent | 2b6594de4d9a70eadeee63ec9549071d6b16a676 (diff) | |
parent | 13ded47cbd898662f48490d28ca00bc50344afd8 (diff) | |
download | libgit2-fef847ae57d74e93563bc04222d9da7007fffc4f.tar.gz |
Merge pull request #5110 from pks-t/pks/wildmatch
Replace fnmatch with wildmatch
Diffstat (limited to 'tests/ignore/path.c')
-rw-r--r-- | tests/ignore/path.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ignore/path.c b/tests/ignore/path.c index bfed297c2..95269959c 100644 --- a/tests/ignore/path.c +++ b/tests/ignore/path.c @@ -230,6 +230,28 @@ void test_ignore_path__globs_and_path_delimiters(void) assert_is_ignored(false, "_test/foo/bar/code/file"); } +void test_ignore_path__globs_without_star(void) +{ + cl_git_rewritefile( + "attr/.gitignore", + "*.foo\n" + "**.bar\n" + ); + + assert_is_ignored(true, ".foo"); + assert_is_ignored(true, "xyz.foo"); + assert_is_ignored(true, ".bar"); + assert_is_ignored(true, "x.bar"); + assert_is_ignored(true, "xyz.bar"); + + assert_is_ignored(true, "test/.foo"); + assert_is_ignored(true, "test/x.foo"); + assert_is_ignored(true, "test/xyz.foo"); + assert_is_ignored(true, "test/.bar"); + assert_is_ignored(true, "test/x.bar"); + assert_is_ignored(true, "test/xyz.bar"); +} + void test_ignore_path__skip_gitignore_directory(void) { cl_git_rewritefile("attr/.git/info/exclude", "/NewFolder\n/NewFolder/NewFolder"); |