Commit eaf8eebf authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'basop-ci/fix-get-float-ref-script' into 'basop-ci-branch'

[BASOP-CI] Another round of fixing the basop ref collection script

See merge request !2043
parents 10744690 2ded29b2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -49,17 +49,17 @@ if ! [[ "$branchname" =~ $BASOP_PATTERN ]]; then
  exit 1
fi

float_ref_branchname="${branchname/basop/ref}"
git_result=$(git branch -av --list "$float_ref_branchname")

# 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
float_ref_branchname="${branchname/basop/ref}"
git_result=$(git branch -av)

# If the branch does not exist, default to "float-pc"
if [[ "$git_result" =~ "$float_ref_branchname" ]]; then
  branchname="${float_ref_branchname}"
else
  branchname="float-pc"
fi

echo "$branchname"