Skip to content

Commit 5509527

Browse files
authored
devops: do a full browser checkout by default on Dev machines (#6411)
The `git fetch --unshallow` is a non-trivial command to run, so we should default to a full checkout unless we're on CI.
1 parent ee835fb commit 5509527

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

browser_patches/prepare_checkout.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ fi
146146
# if there's no checkout folder - checkout one.
147147
if ! [[ -d $CHECKOUT_PATH ]]; then
148148
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
150157
else
151158
echo "-- checking $FRIENDLY_CHECKOUT_PATH folder - OK"
152159
fi

0 commit comments

Comments
 (0)