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

Fixes exception in a top path edge case #242

Merged
merged 3 commits into from Dec 12, 2022
Merged

Fixes exception in a top path edge case #242

merged 3 commits into from Dec 12, 2022

Conversation

voxpelli
Copy link
Contributor

@voxpelli voxpelli commented Dec 9, 2022

The gitignore is throwing an exception when dealing with absolute paths if that path is the very same as the working directory.

This is the case when both expandDirectories: false and onlyFiles: false are set and the input is . and the cwd is set to an absolute path.

I ran across this when using globby in a project of mine and I reproduced it with a test case here and then fixed it.

The gitignore is throwing an exception when dealing with absolute paths if that path is the very same as the working directory.

This is the case when both `expandDirectories: false` and `onlyFiles: false` are set and the input is `.` and the `cwd` is set to an absolute path.

I ran across this when using `globby` in a project of mine and I reproduced it with a test case here and then fixed it.
ignore.js Outdated Show resolved Hide resolved
@voxpelli voxpelli requested a review from fisker December 10, 2022 11:33
@sindresorhus sindresorhus merged commit 917670c into sindresorhus:main Dec 12, 2022
@voxpelli voxpelli deleted the fix-exception-in-top-path-edge-case branch December 12, 2022 17:06
voxpelli pushed a commit to SocketDev/socket-cli-js that referenced this pull request Dec 12, 2022
Makes workaround redundant for bug described in sindresorhus/globby#242
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

3 participants