-
Notifications
You must be signed in to change notification settings - Fork 703
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
Ignore .sock
files in git.WorkTree
#312
Comments
Same issue here: |
I have a |
So the issue lies further down the call stack. |
Commandline git seems to fully ignore the file.
|
That would be great to resolve as we hit this as well. And workarounds are not always possible it seems |
@steiler I think you are on the right direction - we need to handle |
Would it be sufficient to adjust just the hashing behaviour? I'm thinking if the file is not there at all there might be a different execution path that might still try to load that file. But thats my wild imagination on how it might work?! |
@pjbgf tried catching the ModeSocket in The error I get now is: Originating from here: go-git/plumbing/filemode/filemode.go Lines 67 to 98 in a99446e
Which is basically the next call after retrieving the hash. I somewhat have the feeling the Sockets have to be filtered out earlier since calculateHash() go-git/utils/merkletrie/filesystem/node.go Line 142 in b7aa82e
does need to return a byte slice and the calling newChildNode(...) would also error out or add the child to the children slice. go-git/utils/merkletrie/filesystem/node.go Line 117 in b7aa82e
|
The
If I stage a regular file, then override it with a socket, it errors:
Here's the upstream code for that specific validation. Maybe the change you are looking for is a |
Right, thats exactly what I did now here: That does the trick for our usecase. However I'm not sure about further side effects. Would you advise to open this as a PR? |
Feel free to open the PR and tag me for a review. Please add some tests to avoid future regressions. |
.sock files should be ignored when getting the working tree as they cause the following error:
The text was updated successfully, but these errors were encountered: