FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: handle SHA-256 zero OIDs in pre-push by mangod12 · Pull Request #3783 · pre-commit/pre-commit · GitHub

Repository navigation

fix: handle SHA-256 zero OIDs in pre-push - #3783

Closed
mangod12 wants to merge 1 commit into
pre-commit:mainfrom
mangod12:fix/sha256-pre-push-deletion
Closed

mangod12 wants to merge 1 commit into
pre-commit:mainfrom
mangod12:fix/sha256-pre-push-deletion

Conversation

Copy link
Copy Markdown

Fixes #3664.\n\nGit uses a 64-character all-zero object ID for branch deletions in SHA-256 repositories. The pre-push hook now recognizes zero OIDs for both supported object-ID lengths when skipping deleted refs and checking whether the remote ref exists.\n\nRegression coverage exercises branch-deletion input with both 40- and 64-character zero OIDs.\n\nValidation: uv run --with-editable . --with pytest pytest tests/commands/hook_impl_test.py -k 'pre_push_deleting_branch or pre_push_new_branch' -q (4 passed); git diff --check passes.

asottile closed this Oct 18, 2026
pre-commit locked as spam and limited conversation to collaborators Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Z40 = '0' * 40 hardcoding breaks git push --delete on SHA-256 repos

2 participants


Back | FazBrowse Home | New Git URL