File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 146
146
# if there's no checkout folder - checkout one.
147
147
if ! [[ -d $CHECKOUT_PATH ]]; then
148
148
echo " -- $FRIENDLY_CHECKOUT_PATH is missing - checking out.."
149
- git clone --single-branch --depth 1 --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH
149
+ if [[ -n " $CI " ]]; then
150
+ # In CI environment, we re-checkout constantly, so we do a shallow checkout to save time.
151
+ git clone --single-branch --depth 1 --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH
152
+ else
153
+ # In non-CI environment, do a full checkout. This takes time,
154
+ # but liberates from the `git fetch --unshallow`.
155
+ git clone --single-branch --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH
156
+ fi
150
157
else
151
158
echo " -- checking $FRIENDLY_CHECKOUT_PATH folder - OK"
152
159
fi
You can’t perform that action at this time.
0 commit comments