chore: pre-push hook bash 3.2 — no local outside functions.

pull/149/head
VinPropane 2026-05-31 19:46:51 -04:00
parent cfad03e61f
commit 2bde771107
1 changed files with 3 additions and 4 deletions

View File

@ -31,9 +31,9 @@ while read -r local_ref local_sha remote_ref remote_sha; do
continue continue
fi fi
local range="" range=""
if [[ "$remote_sha" == "$zero_sha" ]]; then if [[ "$remote_sha" == "$zero_sha" ]]; then
local base="" base=""
if git show-ref --verify --quiet refs/remotes/origin/main; then if git show-ref --verify --quiet refs/remotes/origin/main; then
base="$(git merge-base origin/main "$local_sha" 2>/dev/null || true)" base="$(git merge-base origin/main "$local_sha" 2>/dev/null || true)"
fi fi
@ -54,9 +54,8 @@ done
# Fallback when stdin is empty (non-standard invocations). # Fallback when stdin is empty (non-standard invocations).
if [[ "$read_any_ref" == false ]]; then if [[ "$read_any_ref" == false ]]; then
local head_sha
head_sha="$(git rev-parse HEAD)" head_sha="$(git rev-parse HEAD)"
local base="" base=""
if git show-ref --verify --quiet refs/remotes/origin/main; then if git show-ref --verify --quiet refs/remotes/origin/main; then
base="$(git merge-base origin/main "$head_sha" 2>/dev/null || true)" base="$(git merge-base origin/main "$head_sha" 2>/dev/null || true)"
fi fi