libretro-buildbot-recipe.sh: Always use the branch in the recipe file.

If the checked out branch does not match the branch name in the recipe
file the script will now make a shallow fetch of the correct branch,
checkout the new branch and then remove the old one. If this is done it
will also build a core with the new branch.
This commit is contained in:
orbea 2017-12-02 10:55:16 -08:00
parent e99abc600f
commit c2275b79f8

View File

@ -750,6 +750,18 @@ while read line; do
cd "$DIR"
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [ "${GIT_BRANCH}" != "${CURRENT_BRANCH}" ]; then
echo "Changing to the branch ${GIT_BRANCH} from ${CURRENT_BRANCH}"
git remote set-branches origin "${GIT_BRANCH}"
git fetch --depth 1 origin "${GIT_BRANCH}"
git checkout "${GIT_BRANCH}"
git branch -D "${CURRENT_BRANCH}"
BUILD="YES"
UPDATE="NO"
fi
if [ "${UPDATE}" != "NO" ]; then
if [ -f .forcebuild ]; then
echo "found .forcebuild file, building $NAME"