-
Notifications
You must be signed in to change notification settings - Fork 220
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
lefthook install
fails in git worktree with Error: exit status 128
when core.hooksPath
doesn't exist
#901
Comments
Wow, thank you for this issue. I am not familiar with Git worktrees yet, but I think this must be fixable. |
When you are in a worktree directory, does this command return 0 or 128 exit status? git rev-parse --path-format=absolute --git-path hooks I've just tried to reproduce the issue but it successfully installed lefthook hooks 🤔 |
lefthook install
fails in git worktree with Error: exit status 128
lefthook install
fails in git worktree with Error: exit status 128
when using a relative core.hooksPath
For our main application, it returns with an exit code Having done that, I just remembered we set |
lefthook install
fails in git worktree with Error: exit status 128
when using a relative core.hooksPath
lefthook install
fails in git worktree with Error: exit status 128
when core.hooksPath
doesn't exist
Reframing this as "lefthook install" failing when core.hooksPath doesn't exist 😁 I'm not sure how likely someone is to run into this in general though. |
Oh, in this case it's good to have this issue as a reference. But I think for lefthook there's no simple fix, since lefthook relies a lot on git configuration. I don't think it's good to check whether |
🔧 Summary
I'm trying out git worktrees as part of my workflow, and when I try to
lefthook install
, I get an error like:Honestly, I'm not positive if hooks are expected to work with worktrees or not 🤔
Lefthook version
❯ lefthook version -f
1.9.3 829cc92
Steps to reproduce
git worktree add -B test-branch ~/path/to/worktree/destination
cd ~/path/to/worktree/destination
lefthook install
Expected results
I'd expect the same results as in a regular git checkout:
Actual results
Possible Solution
Logs / Screenshots
I'm not familiar with git worktrees enough yet, but in practice,
.git
is a file, not a directory:The text was updated successfully, but these errors were encountered: