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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorMatthew Ogilvie <mmogilvi_git@miniinfo.net>2008-04-22 22:19:12 +0400
committerJunio C Hamano <gitster@pobox.com>2008-04-23 08:12:37 +0400
commit82881b38235d0a46a4486dc5dc819c5d0ee3f2c1 (patch)
treed4546c77756c2340eb7645e4375a83d80c7c1fee /attr.c
parent29df2385d09611219c53d07f453794d6146e73a3 (diff)
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>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/attr.c b/attr.c
index 64b77b1663..1a15fad294 100644
--- a/attr.c
+++ b/attr.c
@@ -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)