Commit a0cacc82d5bd3ba6b0240f5e3a7e926e977d3535

Russell Belfer 2014-08-08T15:18:40

For negative matches, always use leading dir match

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/attr_file.c b/src/attr_file.c
index 2f09537..07ffacb 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -534,7 +534,8 @@ int git_attr_fnmatch__parse(
 	}
 
 	if (*pattern == '!' && (spec->flags & GIT_ATTR_FNMATCH_ALLOWNEG) != 0) {
-		spec->flags = spec->flags | GIT_ATTR_FNMATCH_NEGATIVE;
+		spec->flags = spec->flags |
+			GIT_ATTR_FNMATCH_NEGATIVE | GIT_ATTR_FNMATCH_LEADINGDIR;
 		pattern++;
 	}