Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

fix: skip pre-push checks on branch deletion

ohashi-mizuki0c166e14da27
diff --git a/scripts/codex-git-hooks/pre-push b/scripts/codex-git-hooks/pre-push
index 2182cbf4a..82a6b0261 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 <branch>).
+# The pre-push hook receives lines on stdin: <local ref> <local sha> <remote ref> <remote sha>.
+# 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() {