Merge pull request #687 from orbea/reset
libretro-buildbot-recipe.sh: Fix builds with force pushes.
This commit is contained in:
commit
b9a9f58a7e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue