From 48c50cecee13b7d7ed74b00259d97840eef5f8a3 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 7 Mar 2025 10:11:32 +0100 Subject: [PATCH] check if the git is shallow before fetching --- ci_scripts/ci_common.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci_scripts/ci_common.sh b/ci_scripts/ci_common.sh index cf2a8b200..687433c4f 100755 --- a/ci_scripts/ci_common.sh +++ b/ci_scripts/ci_common.sh @@ -28,7 +28,13 @@ setup_xcode_cloud_environment () { bundle config path vendor/bundle bundle install --jobs 4 --retry 3 # Xcode Cloud shallow clones the repo. We need to deepen it to fetch tags, commit history and be able to rebase main on develop at the end of releases. - git fetch --unshallow --quiet + # Check if the repository is shallow + if git rev-parse --is-shallow-repository; then + echo "Repository is shallow. Fetching full history..." + git fetch --unshallow --quiet + else + echo "Repository is already fully cloned." + fi } install_xcode_cloud_brew_dependencies () {