From e142de09280b9198235d03fd612d24b27fb9edaf Mon Sep 17 00:00:00 2001 From: Breadman Da Date: Fri, 19 Aug 2022 04:42:47 -0700 Subject: [PATCH] Make CircleCI run shallow clones of the React Native repo (#34455) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/34455 # Changelog [General][Fixed] - Fix shallow cloning break on main. Introduced in [#34438](https://github.com/facebook/react-native/pull/34438) Failed to fix in [#34453](https://github.com/facebook/react-native/pull/34453) Reviewed By: cipolleschi Differential Revision: D38859731 fbshipit-source-id: 8c5f5ee04ff0f08a6a3af1266ef399a36fde9ae8 --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 611c7caf118712..d881a12aa18626 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,10 +135,10 @@ commands: command: | git clone --branch main --no-checkout "$CIRCLE_REPOSITORY_URL" --single-branch . # Fetch from fork if applicable - if [ -z $CIRCLE_PR_NUMBER ] ; then + if [ -n "$CIRCLE_PR_NUMBER" ] ; then git fetch --force --depth 1 origin +refs/pull/$CIRCLE_PR_NUMBER/head:refs/remotes/origin/pull/$CIRCLE_PR_NUMBER fi - if [ -z $CIRCLE_BRANCH ] ; then + if [ -n "$CIRCLE_BRANCH" ] ; then git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1" else git checkout main