From 850e82d889f374465dc7aa6cb4af3098c7e02f1f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 18 May 2005 14:17:22 -0700 Subject: [PATCH] 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-tree.c | 2 ++ 1 file changed, 2 insertions(+) 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)) -- 2.26.2