From 1070cf88fd7ac2d44163a5dde952966f2a0ac28b Mon Sep 17 00:00:00 2001 From: VinPropane Date: Mon, 4 May 2026 20:30:04 -0400 Subject: [PATCH] chore: require clean working tree in pre-push hook --- scripts/git-hooks/pre-push | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/git-hooks/pre-push b/scripts/git-hooks/pre-push index 9bf2009..7ff7e00 100755 --- a/scripts/git-hooks/pre-push +++ b/scripts/git-hooks/pre-push @@ -4,6 +4,13 @@ set -euo pipefail repo_root="$(git rev-parse --show-toplevel)" cd "$repo_root" +echo "pre-push: checking for a clean working tree" +if [[ -n "$(git status --porcelain)" ]]; then + echo "pre-push: refuse to push — working tree is not clean. Commit, stash, or remove changes first:" >&2 + git status --short >&2 + exit 1 +fi + gdlint_bin="" gdformat_bin=""