From 14a513e05866721f5ceba18cf425568d2f6af143 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 13 Apr 2012 15:00:29 -0700 Subject: 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. --- src/attr_file.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/attr_file.c') diff --git a/src/attr_file.c b/src/attr_file.c index 6568313e5..b2edce90e 100644 --- a/src/attr_file.c +++ b/src/attr_file.c @@ -334,6 +334,10 @@ int git_attr_fnmatch__parse( spec->flags = spec->flags | GIT_ATTR_FNMATCH_FULLPATH; slash_count++; } + /* remember if we see an unescaped wildcard in pattern */ + else if ((*scan == '*' || *scan == '.' || *scan == '[') && + (scan == pattern || (*(scan - 1) != '\\'))) + spec->flags = spec->flags | GIT_ATTR_FNMATCH_HASWILD; } *base = scan; -- cgit v1.2.3