From 16ce36f5c70ad57aba52e8bc3af2d2e1c30fc292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 26 Aug 2018 16:46:21 +0200 Subject: Try to fix git_fetch utils --- scripts/utils | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') 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 } -- cgit v1.2.3