Commit 1949b7d6 authored by Jan Kiene's avatar Jan Kiene
Browse files

check for float companion branch in float repo

parent 6eb6b216
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -46,10 +46,17 @@ branchname_out="main"
# 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_in/basop/ref}"
git_result=$(git branch -a)

# now check in ivas-codec repository if a branch with this name exits
exit_code_ls_remote=0
pushd "${SCRIPTS_DIR}"
git fetch origin
git ls-remote --exit-code --heads origin res/heads/$float_ref_branchname || exit_code_ls_remote=$?
popd

# If the branch does not exist, default to "ivas-float-update"
if [[ "$git_result" =~ "$float_ref_branchname" ]]; then
# NOTE: "git ls-remote --exit-code" returns 2 if the given ref was not found
if [ "$exit_code_ls_remote" -eq "2" ]; then
  branchname_out="${float_ref_branchname}"
fi