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