Backported alphacc's fix for el7/cbs and bash 4.2 (ca63b53c8b)

Signed-off-by: Fabian Arrotin <arrfab@centos.org>
This commit is contained in:
Fabian Arrotin 2022-02-17 13:25:45 +01:00
parent 8ffd801904
commit ae9a7e62f9

View file

@ -139,9 +139,9 @@ else
if [ ".${line:0:1}" = ".*" ]
then
# current branch, put it first
branches=("$branch" "${branches[@]}")
branches=("${branch}" ${branches[@]+"${branches[@]}"})
else
branches=("${branches[@]}" "$branch")
branches=(${branches[@]+"${branches[@]}"} "${branch}")
fi
done <<< "$(git branch -r --contains HEAD | sed 's#origin/##g')"
fi