Skip to content

Commit 3496e7b

Browse files
support spare checkout
1 parent 55624f5 commit 3496e7b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

start.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,24 @@ if [ -d "$CLONE_DIR" ]; then
9696
fi
9797
else
9898

99-
# Clone a fresh copy
99+
if [ -n "$SPARE_CHECKOUT" ]; then
100+
echo "spare checkout"
101+
git init $CLONE_DIR
102+
cd $CLONE_DIR
103+
git remote add origin $REPO
104+
git config core.sparsecheckout true
105+
echo ".codefresh/*" >> .git/info/sparse-checkout
106+
git pull --depth=1 origin master
107+
else
108+
# Clone a fresh copy
100109
echo "cloning $REPO"
101110
git_retry git clone $REPO $CLONE_DIR
102111
cd $CLONE_DIR
103112

104113
if [ -n "$REVISION" ]; then
105114
git checkout $REVISION
106115
fi
116+
117+
fi
118+
107119
fi

0 commit comments

Comments
 (0)