From 850e82d889f374465dc7aa6cb4af3098c7e02f1f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 18 May 2005 14:17:22 -0700 Subject: 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 8fb5729..59d12f2 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)) -- cgit v0.10.2-6-g49f6