From 5509527917ff20af4e4ae31c6b66ea31475048d9 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 5 May 2021 01:12:03 -0700 Subject: [PATCH] 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. --- browser_patches/prepare_checkout.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browser_patches/prepare_checkout.sh b/browser_patches/prepare_checkout.sh index 20e1eb502d..00c4a9504e 100755 --- a/browser_patches/prepare_checkout.sh +++ b/browser_patches/prepare_checkout.sh @@ -146,7 +146,14 @@ fi # if there's no checkout folder - checkout one. if ! [[ -d $CHECKOUT_PATH ]]; then echo "-- $FRIENDLY_CHECKOUT_PATH is missing - checking out.." - git clone --single-branch --depth 1 --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH + if [[ -n "$CI" ]]; then + # In CI environment, we re-checkout constantly, so we do a shallow checkout to save time. + git clone --single-branch --depth 1 --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH + else + # In non-CI environment, do a full checkout. This takes time, + # but liberates from the `git fetch --unshallow`. + git clone --single-branch --branch $BASE_BRANCH $REMOTE_URL $CHECKOUT_PATH + fi else echo "-- checking $FRIENDLY_CHECKOUT_PATH folder - OK" fi