From 1e931c9f16e462857aaa682d6790820bc7ba2f15 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 7 Mar 2025 10:45:57 +0100 Subject: [PATCH] fetch unshallow only in post-clone --- ci_scripts/ci_common.sh | 13 +++++-------- ci_scripts/ci_post_xcodebuild.sh | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci_scripts/ci_common.sh b/ci_scripts/ci_common.sh index 687433c4f..4762ab294 100755 --- a/ci_scripts/ci_common.sh +++ b/ci_scripts/ci_common.sh @@ -27,14 +27,6 @@ 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. - # 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 () { @@ -88,4 +80,9 @@ generate_what_to_test_notes() { echo "$NOTES" > $TESTFLIGHT_DIR_PATH/$TESTFLIGHT_NOTES_FILE_NAME fi +} + +fetch_unshallow_repository() { + # 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 } \ No newline at end of file diff --git a/ci_scripts/ci_post_xcodebuild.sh b/ci_scripts/ci_post_xcodebuild.sh index 973af5961..c8863af3c 100755 --- a/ci_scripts/ci_post_xcodebuild.sh +++ b/ci_scripts/ci_post_xcodebuild.sh @@ -4,6 +4,9 @@ source ci_common.sh setup_xcode_cloud_environment +# 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. +fetch_unshallow_repository + # Upload dsyms no matter the workflow # Perform this step before releasing to github in case it fails. bundle exec fastlane upload_dsyms_to_sentry dsym_path:"$CI_ARCHIVE_PATH/dSYMs"