Skip to content

Commit d19420d

Browse files
wip
1 parent c891cc9 commit d19420d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

start.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ git config --global credential.helper "/bin/sh -c 'echo username=$USERNAME; echo
4848

4949
if [ -n "$SPARE_CHECKOUT" ]; then
5050
echo "spare checkout"
51-
git init $CLONE_DIR
52-
chmod -R 774 $CLONE_DIR
53-
cd $CLONE_DIR
54-
git remote add origin $REPO
55-
git config core.sparsecheckout true
56-
echo "$SOURCE/*" >> .git/info/sparse-checkout
51+
if [ -d "$CLONE_DIR" ]; then
52+
echo folder exists - no need to init
53+
else
54+
git init $CLONE_DIR
55+
chmod -R 774 $CLONE_DIR
56+
cd $CLONE_DIR
57+
git remote add origin $REPO
58+
git config core.sparsecheckout true
59+
echo "$SOURCE/*" >> .git/info/sparse-checkout
60+
fi
61+
5762
git pull --depth=1 origin $REVISION
5863
exit 0
5964
fi

0 commit comments

Comments
 (0)