| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Git SHA-256 repos emit a 64-character zero OID for deletion pushes. Hardcoding only the SHA-1 40-zero form made `git push --delete` fail with Invalid revision range errors. Fixes pre-commit#3664.
| Back | FazBrowse Home | New Git URL |
Summary
pre_commit/commands/hook_impl.py hardcoded Z40 = '0' * 40 for deletion / new-branch detection on pre-push. SHA-256 repositories emit a 64-character zero OID, so git push --delete fell through into git diff against the zero OID and failed.
Accept an all-zero OID of length 40 or 64 via _is_zero_oid().
Fixes #3664.
Test plan