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
Bug when running lint-staged in git worktree #783
Comments
Thanks for the report! We do a similar thing for the submodules. I guess some reading is in order to find the correct location: https://git-scm.com/docs/git-worktree#_details |
Thanks for the quick reply! Yes, the contents of the
I was looking at the code and looks like the fix may be as straightforward as modifying the |
I opened a PR #784 that fixes this issue by always parsing the |
🎉 This issue has been resolved in version 10.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
👏 I'm impressed how quickly this was fixed. Thank you! |
@bantic thanks! You can express how impressed you are here https://opencollective.com/lint-staged ;) |
Adds support for git worktrees, see lint-staged/lint-staged#783
Description
Reproduced using version 10.0.4.
The lint-staged "prepare" step fails when it is run inside a git worktree because the worktree doesn't have a local
.git
directory, it has a.git
file instead. When the "prepare" step runs it fails with a message like:Steps to reproduce
The following steps should reproduce this for any checked-out repo that is set up with lint-staged:
git worktree add ../some-other-path
cd ../some-other-path
npm install
I created an example repo that serves as a minimal reproduction: https://github.com/bantic/try-lint-staged
Debug Logs
expand to view
Environment
lint-staged
: v10.0.4The text was updated successfully, but these errors were encountered: