Merge pull request #687 from orbea/reset

libretro-buildbot-recipe.sh: Fix builds with force pushes.
This commit is contained in:
Andrés 2018-01-07 12:44:33 -05:00 committed by GitHub
commit b9a9f58a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -619,15 +619,17 @@ while read line; do
HEAD="$(git --work-tree="$DIR" --git-dir="$DIR/.git" rev-parse HEAD)" || \
{ echo "git directory broken, removing $DIR and skipping $NAME."; \
rm -rfv -- "$DIR" && continue; }
echo "pulling changes from repo $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" pull
echo "fetching changes from repo $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" fetch origin "$GIT_BRANCH"
echo "resetting repo state $URL..."
git --work-tree="." --git-dir=".git" -C "$DIR" reset --hard FETCH_HEAD
git --work-tree="$DIR" --git-dir="$DIR/.git" clean -xdf -e .libretro-core-recipe
if [ "$HEAD" = "$(git --work-tree="$DIR" --git-dir="$DIR/.git" rev-parse HEAD)" ] && [ "${BUILD}" != "YES" ]; then
BUILD="NO"
else
echo "resetting repo state $URL..."
git --work-tree="$DIR" --git-dir="$DIR/.git" reset --hard FETCH_HEAD
git --work-tree="$DIR" --git-dir="$DIR/.git" clean -xdf -e .libretro-core-recipe
BUILD="YES"
fi
fi