sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Fixes exception in a top path edge case #242

Closed voxpelli closed 1 year ago

voxpelli commented 1 year ago

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.