← 输入框|github.com|刷新
Skip to content

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

@mangod12

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 asottile closed this Oct 18, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Oct 18, 2026
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