From eae37a04b4321143e84d76c82589208a9e2e2c07 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 18 Dec 2023 06:28:48 +0000 Subject: [PATCH] Don't allow image pushes with unstaged changes --- push-images.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/push-images.sh b/push-images.sh index 622afdd..7f96424 100755 --- a/push-images.sh +++ b/push-images.sh @@ -1,3 +1,11 @@ +fail() +{ + echo "$1" 1>&2 + exit 1 +} + +git diff-index --quiet HEAD -- || fail "Images must not be pushed with uncommitted changes!" + set -e TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`