From 5a9d1e74ac191636b64f1c2ec77129a003955c98 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Sat, 2 Dec 2023 14:57:09 -0600 Subject: Require pristine tree. Fix tag bug. --- prepare | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prepare b/prepare index 2d18fb0..35fe28b 100755 --- a/prepare +++ b/prepare @@ -137,7 +137,7 @@ done # not prevent someone from being stupid, but they can avoid some # common errors. We want to reduce surprises/ensure consistency. # -VTAG=$(git describe --abbrev=0 2>/dev/null || true); +VTAG=$(git describe --tags --abbrev=0 2>/dev/null || true); if test -z "${VTAG}"; then printf "E: you need to tag at least one commit!\n"; exit 1; @@ -150,6 +150,10 @@ if test $(git ls-remote --tags origin ${VTAG} | wc -l) -eq 0; then printf "E: tag '%s' does not exist on origin!\n" "${VTAG}"; exit 1; fi +if test $(git status --porcelain | wc -l) -gt 0; then + printf "E: tree is not clean; aborting!\n" "${VTAG}"; + exit 1; +fi ## -- cgit v1.2.3-70-g09d2