treefmt .
at the root of the project fails if the project root is a symlink
#594
Labels
bug
Something isn't working
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
If the root of your project is a symlink, and you try running
treefmt .
at the root of the repo, you'll get a segfault.To Reproduce
Steps to reproduce the behavior:
./prj
with a working treefmt configuration../prj-link
:ln -s prj prj-link
.cd prj-link
treefmt .
Expected behavior
We certainly shouldn't crash. I would expect this to format the whole repo despite the fact that the user have given us a path to a symlink, which is in opposition to the intent/thinking behind #528.
System information
N/A
Additional context
This was broken in #528. Root cause:
readers
array.readers
array here: https://github.com/numtide/treefmt/blob/v2.3.1/walk/walk.go#L160c.current.Read
wherec.current == nil
here: https://github.com/numtide/treefmt/blob/v2.3.1/walk/walk.go#L165. Boom.The text was updated successfully, but these errors were encountered: