From ae3cdfe1123d153f720bbe4a4abc97ed3e9f65a4 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Mon, 8 Nov 2010 01:04:58 +0700 Subject: dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index d1e5e5e5bf..b2dfb69eb5 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; -- cgit v1.3