summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-07-20 11:26:00 +0100
committerGitHub <noreply@github.com>2019-07-20 11:26:00 +0100
commite07dbc92d113fbddd2a042b45ef1a01347492a4c (patch)
tree0729eacdcdc78f7a134ff4d4baa2667b911e15cc /tests
parentfd7a384b6849a407677c592f269603f4075d662a (diff)
parent6f6340afeca17bf0773e2450efc7c96f7ca8bd5d (diff)
downloadlibgit2-e07dbc92d113fbddd2a042b45ef1a01347492a4c.tar.gz
Merge pull request #5173 from pks-t/pks/gitignore-wildmatch-error
ignore: fix determining whether a shorter pattern negates another
Diffstat (limited to 'tests')
-rw-r--r--tests/ignore/path.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ignore/path.c b/tests/ignore/path.c
index 95269959c..5daf32901 100644
--- a/tests/ignore/path.c
+++ b/tests/ignore/path.c
@@ -560,3 +560,18 @@ void test_ignore_path__escaped_space(void)
assert_is_ignored(false, "bar\\\\\\");
assert_is_ignored(false, "bar\\\\\\ ");
}
+
+void test_ignore_path__invalid_pattern(void)
+{
+ cl_git_rewritefile("attr/.gitignore", "[");
+ assert_is_ignored(false, "[f");
+ assert_is_ignored(false, "f");
+}
+
+void test_ignore_path__negative_prefix_rule(void)
+{
+ cl_git_rewritefile("attr/.gitignore", "ff*\n!f\n");
+ assert_is_ignored(true, "fff");
+ assert_is_ignored(true, "ff");
+ assert_is_ignored(false, "f");
+}