Skip to content

Commit

Permalink
diff-tree: don't match non-directories as partial pathnames
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
Linus Torvalds committed May 18, 2005
1 parent ed1a368 commit 850e82d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 850e82d

Please sign in to comment.