release: Be explicit about which branch was expected.

This commit is contained in:
Alex Vandiver 2022-11-15 11:06:59 -05:00 committed by Tim Abbott
parent abb7a63b62
commit e95e8b985f
1 changed files with 4 additions and 3 deletions

View File

@ -27,11 +27,12 @@ branch=$(git rev-parse --abbrev-ref HEAD)
is_major_release= is_major_release=
if [[ "$version" =~ ^[0-9]+\.0$ ]]; then if [[ "$version" =~ ^[0-9]+\.0$ ]]; then
[ "$branch" == "main" ] \ [ "$branch" == "main" ] \
|| fail "Did not expect $version to be released from $branch" || fail "Did not expect $version to be released from $branch, expected main"
is_major_release=1 is_major_release=1
else else
[ "$branch" == "$(echo "$version" | perl -ple 's/\..*/.x/')" ] \ expected_branch="$(echo "$version" | perl -ple 's/\..*/.x/')"
|| fail "Did not expect $version to be released from $branch" [ "$branch" == "$expected_branch" ] \
|| fail "Did not expect $version to be released from $branch, expected $expected_branch"
fi fi
# shellcheck source=lib/git-tools.bash # shellcheck source=lib/git-tools.bash