gitattributes: Fix subdirectory attributes specified from root directory

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthew Ogilvie
2008-04-22 12:19:12 -06:00
committed by Junio C Hamano
parent 29df2385d0
commit 82881b3823
2 changed files with 11 additions and 1 deletions

4
attr.c
View File

@ -546,7 +546,9 @@ static int path_matches(const char *pathname, int pathlen,
(baselen && pathname[baselen] != '/') ||
strncmp(pathname, base, baselen))
return 0;
return fnmatch(pattern, pathname + baselen + 1, FNM_PATHNAME) == 0;
if (baselen != 0)
baselen++;
return fnmatch(pattern, pathname + baselen, FNM_PATHNAME) == 0;
}
static int fill_one(const char *what, struct match_attr *a, int rem)