#!/usr/bin/env bash set -euo pipefail REPO_ROOT="$(git rev-parse --show-toplevel)" # Git exports repository-local overrides to hooks. Do not let test fixtures in # temporary directories inherit this worktree's refs, index or shared config. git_local_env="$(git rev-parse --local-env-vars)" while IFS= read -r git_env_name; do unset "$git_env_name" done <<< "$git_local_env" unset git_local_env git_env_name # One skip variable, PIPE_SKIP_PREPUSH_GATE, shared with the gate script. The # hook used to check PIPE_SKIP_PREPUSH_CI_GATE while the script checked # PIPE_SKIP_PREPUSH_GATE, so each documented name worked in only one place. if [ "${PIPE_SKIP_PREPUSH_GATE:-0}" != "1" ]; then "$REPO_ROOT/scripts/pre-push-ci-gate.sh" else echo "[pre-push] PIPE_SKIP_PREPUSH_GATE=1; skipping local CI gate" >&2 fi