chore(is-clean.sh): also allow releases on test branch

This commit is contained in:
Sarah Vaupel 2023-07-14 22:45:19 +00:00
parent bfe9bfda0a
commit 0567f438f6

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>
# SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
@ -13,15 +13,17 @@ if [ -n "$(git status --porcelain)" ]; then
exit 1
fi
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Not on master" >&2
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ $branch != "master" && $branch != "test" ]; then
echo "Not on master or test" >&2
exit 1
fi
ourHash=$(git rev-parse HEAD)
theirHash=$(git ls-remote origin -h refs/heads/master | awk '{ print $1; }')
theirHash=$(git ls-remote origin -h refs/heads/$branch | awk '{ print $1; }')
if [ "$theirHash" != "$ourHash" ]; then
echo "Local HEAD is not up to date with remote master" >&2
echo "Local HEAD is not up to date with remote $branch" >&2
exit 1
fi