From 242c975b754fd2027c7c4e775071453c6c2d117c Mon Sep 17 00:00:00 2001 From: orbea Date: Fri, 22 Dec 2017 14:48:34 -0800 Subject: [PATCH] libretro-buildbot-recipe.sh: Use the correct .git directory. --- libretro-buildbot-recipe.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index 405ca7d3..9f56b5a4 100755 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -624,19 +624,25 @@ while read line; do fi fi - cd "$DIR" || { echo "Failed to cd to ${DIR}, skipping ${NAME}"; continue; } - - CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" + CURRENT_BRANCH="$(git --work-tree="$DIR" --git-dir="$DIR/.git" rev-parse --abbrev-ref HEAD)" if [ "${GIT_BRANCH}" != "${CURRENT_BRANCH}" ] && [ "${TRAVIS:-0}" = "0" ]; 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}" + git --work-tree="$DIR" --git-dir="$DIR/.git" remote set-branches origin "${GIT_BRANCH}" + git --work-tree="$DIR" --git-dir="$DIR/.git" fetch --depth 1 origin "${GIT_BRANCH}" + git --work-tree="$DIR" --git-dir="$DIR/.git" checkout "${GIT_BRANCH}" + git --work-tree="$DIR" --git-dir="$DIR/.git" branch -D "${CURRENT_BRANCH}" BUILD="YES" fi + ( + cd -- "$DIR" || { echo "Failed to cd to ${DIR}, skipping ${NAME}"; continue; } + + if git config --file .gitmodules --name-only --get-regexp path 2>&1 >/dev/null; then + git --work-tree="." --git-dir=".git" submodule update --init --recursive + fi + ) + for core in 81 emux_nes emux_sms fuse gw mgba; do if [ "${PREVCORE}" = "$core" ] && [ "${PREVBUILD}" = "YES" ] && [ "${NAME}" = "$core" ]; then FORCE="YES" @@ -644,12 +650,6 @@ while read line; do fi done - if git config --file .gitmodules --name-only --get-regexp path 2>&1 >/dev/null; then - git submodule update --init --recursive - fi - - cd "$WORK" - if [ "${BUILD}" = "YES" ] || [ "${FORCE}" = "YES" ]; then touch $TMPDIR/built-cores CORES_BUILT=YES