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>2012-04-14 02:00:29 +0400
committerRussell Belfer <rb@github.com>2012-04-14 02:00:29 +0400
commit14a513e05866721f5ceba18cf425568d2f6af143 (patch)
tree4c31553a2c971adf579d2c5c287749ce45949c8c /tests-clar/attr
parentd1f331564da9d6110b80b538a501da0c66e59142 (diff)
Add support for pathspec to diff and status
This adds preliminary support for pathspecs to diff and status. The implementation is not very optimized (it still looks at every single file and evaluated the the pathspec match against them), but it works.
Diffstat (limited to 'tests-clar/attr')
-rw-r--r--tests-clar/attr/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests-clar/attr/file.c b/tests-clar/attr/file.c
index 132b906cd..6aeaa5135 100644
--- a/tests-clar/attr/file.c
+++ b/tests-clar/attr/file.c
@@ -20,7 +20,7 @@ void test_attr_file__simple_read(void)
cl_assert(rule != NULL);
cl_assert_strequal("*", rule->match.pattern);
cl_assert(rule->match.length == 1);
- cl_assert(rule->match.flags == 0);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
cl_assert(rule->assigns.length == 1);
assign = get_assign(rule, 0);
@@ -74,14 +74,16 @@ void test_attr_file__match_variants(void)
rule = get_rule(4);
cl_assert_strequal("pat4.*", rule->match.pattern);
- cl_assert(rule->match.flags == 0);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
rule = get_rule(5);
cl_assert_strequal("*.pat5", rule->match.pattern);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
rule = get_rule(7);
cl_assert_strequal("pat7[a-e]??[xyz]", rule->match.pattern);
cl_assert(rule->assigns.length == 1);
+ cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
assign = get_assign(rule,0);
cl_assert_strequal("attr7", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value));