diff options
-rw-r--r-- | scripts/utils | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/utils b/scripts/utils index b88d4a4..58372c5 100644 --- a/scripts/utils +++ b/scripts/utils @@ -14,10 +14,10 @@ git_fetch() { local BRANCH="$3" [ -n "$BRANCH" ] || BRANCH=master local GITARGS="--git-dir='$WORKSPACE/$2' --bare" - if [ ! -d "$WORKSPACE/$2" ]; then - git clone --bare "$1" "$WORKSPACE/$2" - else + if [ -d "$WORKSPACE/$2/.git" ]; then git $GITARGS fetch --prune --prune-tags --force "$1" "$BRANCH:$BRANCH" + else + git clone --bare "$1" "$WORKSPACE/$2" fi git $GITARGS worktree add --detach $2 $BRANCH } |