Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-08-09 21:52:35 +0400
committerRussell Belfer <rb@github.com>2013-08-09 21:52:35 +0400
commit4ba64794aee983483eef659623a765d61311ded1 (patch)
tree33b048d3b6bda96f53058f43ff6303c257fcb7fb /tests-clar/attr
parentfbb6c0c84c65d5e36ad552040897cfbde83b59b2 (diff)
Revert PR #1462 and provide alternative fix
This rolls back the changes to fnmatch parsing from commit 2e40a60e847d6c128af23e24ea7a8efebd2427da except for the tests that were added. Instead this adds couple of new flags that can be passed in when attempting to parse an fnmatch pattern. Also, this changes the pathspec match logic to special case matching a filename with a '!' prefix against a negative pattern. This fixes the build.
Diffstat (limited to 'tests-clar/attr')
-rw-r--r--tests-clar/attr/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests-clar/attr/file.c b/tests-clar/attr/file.c
index 8866fd9bd..4eb1d22fe 100644
--- a/tests-clar/attr/file.c
+++ b/tests-clar/attr/file.c
@@ -49,7 +49,6 @@ void test_attr_file__match_variants(void)
cl_assert(rule);
cl_assert_equal_s("pat0", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat0"));
- cl_assert(rule->match.flags == 0);
cl_assert(rule->assigns.length == 1);
assign = get_assign(rule,0);
cl_assert_equal_s("attr0", assign->name);
@@ -59,16 +58,16 @@ void test_attr_file__match_variants(void)
rule = get_rule(1);
cl_assert_equal_s("pat1", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat1"));
- cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_NEGATIVE);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_NEGATIVE) != 0);
rule = get_rule(2);
cl_assert_equal_s("pat2", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat2"));
- cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_DIRECTORY);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_DIRECTORY) != 0);
rule = get_rule(3);
cl_assert_equal_s("pat3dir/pat3file", rule->match.pattern);
- cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_FULLPATH);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_FULLPATH) != 0);
rule = get_rule(4);
cl_assert_equal_s("pat4.*", rule->match.pattern);
@@ -89,7 +88,6 @@ void test_attr_file__match_variants(void)
rule = get_rule(8);
cl_assert_equal_s("pat8 with spaces", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat8 with spaces"));
- cl_assert(rule->match.flags == 0);
rule = get_rule(9);
cl_assert_equal_s("pat9", rule->match.pattern);