Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sbt bug #6453 #319

Merged
merged 1 commit into from
May 31, 2021
Merged

Fix sbt bug #6453 #319

merged 1 commit into from
May 31, 2021

Conversation

eatkins
Copy link
Contributor

@eatkins eatkins commented May 30, 2021

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.
@eatkins
Copy link
Contributor Author

eatkins commented May 30, 2021

I tested in a local sbt build that sbt/sbt#6453 was fixed by this change.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eatkins!

@eed3si9n eed3si9n merged commit 73c5bda into sbt:develop May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants