diff --git a/scripts/codex-git-hooks/pre-push b/scripts/codex-git-hooks/pre-push index 2182cbf4..82a6b026 100644 --- a/scripts/codex-git-hooks/pre-push +++ b/scripts/codex-git-hooks/pre-push @@ -16,6 +16,20 @@ if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then exit 0 fi +# Skip checks for branch deletion pushes (e.g., git push origin --delete ). +# The pre-push hook receives lines on stdin: . +# For deletions, the local sha is the zero OID. +is_delete_only=true +while read -r _local_ref local_sha _remote_ref _remote_sha; do + if [[ "$local_sha" != "0000000000000000000000000000000000000000" ]]; then + is_delete_only=false + break + fi +done +if [[ "$is_delete_only" == "true" ]]; then + exit 0 +fi + ran_any_check=0 log() {