chore: pre-push hook bash 3.2 — no local outside functions.
parent
cfad03e61f
commit
2bde771107
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue