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=""