From 2ded29b229cb4db42b1ca2cfd33178541867a5b8 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 14 Mar 2025 14:53:17 +0100 Subject: [PATCH] change check for ref branch existing --- ci/get_float_ref_branch_name.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/get_float_ref_branch_name.sh b/ci/get_float_ref_branch_name.sh index 6c183bfb48..fe160da023 100755 --- a/ci/get_float_ref_branch_name.sh +++ b/ci/get_float_ref_branch_name.sh @@ -49,17 +49,17 @@ if ! [[ "$branchname" =~ $BASOP_PATTERN ]]; then exit 1 fi +# The float ref branch is just the same name, but with basop -> ref replacement +# Replace only the first occurrence, as "basop" may be present in the later description +# If the format is correct, then before "_basop", only numbers can occur float_ref_branchname="${branchname/basop/ref}" -git_result=$(git branch -av --list "$float_ref_branchname") +git_result=$(git branch -av) # If the branch does not exist, default to "float-pc" -if [[ -z "$git_result" ]]; then - branchname="float-pc" -else - # The float ref branch is just the same name, but with basop -> ref replacement - # Replace only the first occurrence, as "basop" may be present in the later description - # If the format is correct, then before "_basop", only numbers can occur +if [[ "$git_result" =~ "$float_ref_branchname" ]]; then branchname="${float_ref_branchname}" +else + branchname="float-pc" fi echo "$branchname" -- GitLab