Skip to content

Commit

Permalink
diff-tree: fix up comparison of "interesting" sub-trees
Browse files Browse the repository at this point in the history
We used to trigger the "interesting subdirectory" check for any
matching name that started with the same character series, regardless
of whether it had the matching slash or not.
  • Loading branch information
Linus Torvalds committed May 18, 2005
1 parent 7384889 commit cb6c8ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ static int interesting(void *tree, unsigned long size, const char *base)
if (pathlen > matchlen)
continue;

if (matchlen > pathlen) {
if (match[pathlen] != '/')
continue;
}

if (strncmp(path, match, pathlen))
continue;

Expand Down

0 comments on commit cb6c8ed

Please sign in to comment.