From 0567f438f6ee2ba9425679ce1a5db91540454960 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 14 Jul 2023 22:45:19 +0000 Subject: [PATCH] chore(is-clean.sh): also allow releases on test branch --- is-clean.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/is-clean.sh b/is-clean.sh index a13382f2b..27625702f 100755 --- a/is-clean.sh +++ b/is-clean.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: 2022 Gregor Kleen +# SPDX-FileCopyrightText: 2022-2023 Sarah Vaupel , Gregor Kleen # # 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