#!/usr/bin/env bash # # pre-commit hook — block commits when the canonical/mirror pair drifts. # # Enable by running: git config core.hooksPath githooks # (handled by make install-hooks; idempotent on re-run.) set -euo pipefail repo_root="$(git rev-parse --show-toplevel)" "$repo_root/scripts/sync-check.sh" || { echo "" >&2 echo "pre-commit: canonical/mirror drift detected. Commit blocked." >&2 exit 1 }