#!/usr/bin/env bash
# sh-cherrypick pre-push SHIM.
#
# core.hooksPath is a SINGLE directory, not a search path. Pointing this repo at .githooks/
# SHADOWS the machine-global hook dir (~/.config/git/hooks), which holds the MANDATORY Sea
# Haven security pre-push gate. To avoid silently disabling that gate, this shim re-execs the
# global pre-push, passing through args + stdin and preserving its exit code.
GLOBAL="${SH_GLOBAL_HOOKS:-$HOME/.config/git/hooks}/pre-push"

if [ -x "$GLOBAL" ]; then
  exec "$GLOBAL" "$@"
fi

echo "sh-cherrypick: no global pre-push at $GLOBAL — nothing to delegate to." >&2
exit 0
