From 66927e65d01429330f771c55958598fd76d157c1 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 20 Jul 2024 04:17:42 +0200 Subject: [PATCH] Prevent changing the working directory --- scripts/Common/Software/git/main.fish | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/Common/Software/git/main.fish b/scripts/Common/Software/git/main.fish index 63c18e40..90aea20c 100644 --- a/scripts/Common/Software/git/main.fish +++ b/scripts/Common/Software/git/main.fish @@ -41,32 +41,30 @@ begin begin # Git Flow set -l dir (mktemp -d) - pushd "$dir" > /dev/null begin set -l key "$root.git.flow" set -l mainKey "$key.mainBranch" set -l devKey "$key.devBranch" - git init - git commit --allow-empty -m "Initial commit" > /dev/null - git branch master || true &> /dev/null - git branch main || true &> /dev/null - git branch dev || true &> /dev/null - yes "" | git flow init &> /dev/null + git -C "$dir" init + git -C "$dir" commit --allow-empty -m "Initial commit" > /dev/null + git -C "$dir" branch master || true &> /dev/null + git -C "$dir" branch main || true &> /dev/null + git -C "$dir" branch dev || true &> /dev/null + yes "" | git -C "$dir" flow init &> /dev/null if isSet "$mainKey" - sudo git flow config set $configArgs master (getConfig "$mainKey") > /dev/null + sudo git -C "$dir" flow config set $configArgs master (getConfig "$mainKey") > /dev/null else true end if isSet "$devKey" - sudo git flow config set $configArgs develop (getConfig "$devKey") > /dev/null + sudo git -C "$dir" flow config set $configArgs develop (getConfig "$devKey") > /dev/null else true end end - popd > /dev/null rm -rf "$dir" end