From d13664d51506f1e0aded60486d1447ce977503e6 Mon Sep 17 00:00:00 2001 From: orbea Date: Fri, 22 Dec 2017 19:08:52 -0800 Subject: [PATCH] libretro-buildbot-recipe.sh: Use git -C to change directories. This avoids a subshell and does not require using 'cd' here. --- libretro-buildbot-recipe.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libretro-buildbot-recipe.sh b/libretro-buildbot-recipe.sh index 9f56b5a4..5e6030ab 100755 --- a/libretro-buildbot-recipe.sh +++ b/libretro-buildbot-recipe.sh @@ -635,13 +635,9 @@ while read line; do 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 - ) + if git config --file "$DIR/.gitmodules" --name-only --get-regexp path 2>&1 >/dev/null; then + git --work-tree="." --git-dir=".git" -C "$DIR" 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