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=
if [[ "$version" =~ ^[0-9]+\.0$ ]]; then
[ "$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
else
[ "$branch" == "$(echo "$version" | perl -ple 's/\..*/.x/')" ] \
|| fail "Did not expect $version to be released from $branch"
expected_branch="$(echo "$version" | perl -ple 's/\..*/.x/')"
[ "$branch" == "$expected_branch" ] \
|| fail "Did not expect $version to be released from $branch, expected $expected_branch"
fi
# shellcheck source=lib/git-tools.bash