set -euo pipefail
if [ "${GIT_NO_CHECK:-0}" = "1" ]; then
exit 0
fi
while read -r _local_ref _local_sha remote_ref _remote_sha; do
case "$remote_ref" in
refs/heads/gh-pages|gh-pages) exit 0 ;;
esac
done
if ! command -v just &>/dev/null; then
exit 0
fi
REPO_ROOT="$(git rev-parse --show-toplevel)"
echo "[check] Running just check..."
if ! just --justfile "$REPO_ROOT/Justfile" check; then
echo ""
echo "[check] Failed. Run 'just check' to see details, 'cargo fmt' to fix formatting."
exit 1
fi
echo "[check] All checks passed."