summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29df238)
raw | patch | inline | side by side (parent: 29df238)
author | Matthew Ogilvie <mmogilvi_git@miniinfo.net> | |
Tue, 22 Apr 2008 18:19:12 +0000 (12:19 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 23 Apr 2008 04:12:37 +0000 (21:12 -0700) |
Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c | patch | blob | history | |
t/t0003-attributes.sh | patch | blob | history |
index 64b77b16636482d3448027d7823e5dc07861faa5..1a15fad294c5db1f922e686995e215b94b89b9a0 100644 (file)
--- a/attr.c
+++ b/attr.c
(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)
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 47f08a46c260a612eff2bcf88bef84ee231897c1..e7fa4f5d43ffb95e79a295b3969ea1ad0160a82e 100755 (executable)
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
mkdir -p a/b/d a/c &&
(
echo "f test=f"
+ echo "a/i test=a/i"
) >.gitattributes &&
(
echo "g test=a/g" &&
'
+test_expect_success 'root subdir attribute test' '
+
+ attr_check a/i a/i &&
+ attr_check subdir/a/i unspecified
+
+'
+
test_done