#!/usr/bin/env bash
# .githooks/pre-push — fmt + drift-check + cross-version compile gate
# before any push.
#
# Installed via `bash scripts/install-hooks.sh`. Skips on
# `git push --no-verify`. The compile-matrix step skips on hosts
# without every pg-version toolchain via COMPILE_MATRIX_SKIP=1
# (CI still covers the full matrix).

set -euo pipefail
root="$(git rev-parse --show-toplevel)"
cargo fmt --all -- --check
bash "$root/scripts/drift-check.sh"
bash "$root/scripts/compile-matrix.sh"
