Skip to content

Detect push deletions on SHA-256 repos - #3760

Closed
00200200 wants to merge 2 commits into
pre-commit:mainfrom
00200200:fix/sha256-null-oid
Closed

00200200 wants to merge 2 commits into
pre-commit:mainfrom
00200200:fix/sha256-null-oid

Conversation

@00200200

Copy link
Copy Markdown

Summary

  • Treat both 40- and 64-zero SHAs as the null OID in pre-push handling
  • Fixes git push --delete failing on --object-format=sha256 repos

Fixes #3664

Test plan

  • Unit tests for _is_null_oid
  • CI green

Michał Furgała and others added 2 commits September 22, 2026 22:40
Null OID is 40 zeros for SHA-1 and 64 zeros for SHA-256. Comparing only
against Z40 missed deletion pushes on object-format=sha256 repos.
@asottile asottile closed this Sep 22, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Sep 22, 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