sbt / io

IO module for sbt
Apache License 2.0
40 stars 45 forks source link

Fix sbt bug #6453 #319

Closed eatkins closed 3 years ago

eatkins commented 3 years ago

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.

eatkins commented 3 years ago

I tested in a local sbt build that https://github.com/sbt/sbt/issues/6453 was fixed by this change.