aboutsummaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-11-08 01:04:58 +0700
committerJunio C Hamano <gitster@pobox.com>2010-11-08 11:39:23 -0800
commitae3cdfe1123d153f720bbe4a4abc97ed3e9f65a4 (patch)
treeac35f1cd0a104ae090050a57fb5d1b560db3974b /dir.c
parentaf77aee9cac51c2036e6019b4aebec2049f03e6b (diff)
downloadgit-ae3cdfe1123d153f720bbe4a4abc97ed3e9f65a4.tar.gz
git-ae3cdfe1123d153f720bbe4a4abc97ed3e9f65a4.tar.xz
dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout
Commit c84de70 (excluded_1(): support exclude files in index - 2009-08-20) tries to work around the fact that there is no directory/file information in index entries, therefore EXC_FLAG_MUSTBEDIR match would fail. Unfortunately the workaround is flawed. This fixes it. Reported-by: Thomas Rinderknecht <thomasr@sailguy.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index d1e5e5e5b..b2dfb69eb 100644
--- a/dir.c
+++ b/dir.c
@@ -360,7 +360,8 @@ int excluded_from_list(const char *pathname,
if (x->flags & EXC_FLAG_MUSTBEDIR) {
if (!dtype) {
- if (!prefixcmp(pathname, exclude))
+ if (!prefixcmp(pathname, exclude) &&
+ pathname[x->patternlen] == '/')
return to_exclude;
else
continue;