A user pointed out that if two globs were specificed that looked like
a/b.txt and a/b/**, then FileTreeView.list(globs) would not return the
children in the subdirectory a/b. There is an optimization that
FileTreeView.list makes when handling paths that may have multiple globs
matching the same prefix. At the fork point (which in the example above
is the directory a), we save all of the files that we find in there so
that as the recursive algorithm proceeds, it doesn't necessarily need to
make an additional syscall to determine whether the next file it wants
to look at is a path or a directory. The problem here though was that we
incorrectly passed the parent (fork) path into the listPath method
rather than the path itself.
A user pointed out that if two globs were specificed that looked like a/b.txt and a/b/**, then FileTreeView.list(globs) would not return the children in the subdirectory a/b. There is an optimization that FileTreeView.list makes when handling paths that may have multiple globs matching the same prefix. At the fork point (which in the example above is the directory a), we save all of the files that we find in there so that as the recursive algorithm proceeds, it doesn't necessarily need to make an additional syscall to determine whether the next file it wants to look at is a path or a directory. The problem here though was that we incorrectly passed the parent (fork) path into the listPath method rather than the path itself.