-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
Empty .git/hooks/pre-commit.legacy File causes OSError #2448
Comments
how did that file get there to begin with? do you have reproduction steps? |
With the listed config file in place, all I did was |
I can't reproduce -- the only way that would happen is if you already had created an (invalid) empty |
Hmmm now that I removed the empty file, I cannot reproduce myself... perhaps the empty file was created by an OS/NAS issue... However, when the empty |
I don't think that's accurate either -- nothing changed in either way -- this is a user error and not a pre-commit issue |
If this is a user error, does anyone have a solution? Thanks! |
delete the empty file |
search tried in the issue tracker
is:issue is:open OSError
describe your issue
In the latest version (2.19.0)
pre-commit install
appears to create an empty .git/hooks/pre-commit.legacy file. This causes an OSError when git (version 2.31.1) attempts to run the actual pre-commit hook.Actual reported error:
This appears to be the same core issue as: #1350
If I manually modify the empty file and add a shebang, the error subsides. However, the real solution is probably to avoid the creation of the empty file altogether.
pre-commit --version
pre-commit 2.19.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
version information
error information
The text was updated successfully, but these errors were encountered: