mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
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".
This commit is contained in:
parent
ed1a368ba1
commit
850e82d889
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user