From: Linus Torvalds Date: Wed, 18 May 2005 21:17:22 +0000 (-0700) Subject: diff-tree: don't match non-directories as partial pathnames X-Git-Tag: v0.99~548 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=850e82d889f374465dc7aa6cb4af3098c7e02f1f;p=git.git diff-tree: don't match non-directories as partial pathnames This normally doesn't matter, but if you have a filename that is sometimes a directory and sometimes a regular file (or symlink), we don't want the regular file case to trigger a "partial match". --- diff --git a/diff-tree.c b/diff-tree.c index 8fb572936..59d12f2ba 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -204,6 +204,8 @@ static int interesting(void *tree, unsigned long size, const char *base) if (matchlen > pathlen) { if (match[pathlen] != '/') continue; + if (!S_ISDIR(mode)) + continue; } if (strncmp(path, match, pathlen))