From e95e8b985f5fbb5afefc0189fcd1e38c09cb380f Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 15 Nov 2022 11:06:59 -0500 Subject: [PATCH] release: Be explicit about which branch was expected. --- tools/release | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/release b/tools/release index afb43058fb..9189973c12 100755 --- a/tools/release +++ b/tools/release @@ -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