From b228669276fbecaa373cffa908f247623d2ae953 Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Tue, 10 Dec 2024 09:04:45 -0600 Subject: [PATCH] helpers: Use shallow clones for android repo We don't need full repo histories when syncing. This will make CI a little faster and less error prone. Signed-off-by: Andy Doan --- helpers.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/helpers.sh b/helpers.sh index d9e3da40..6c622584 100644 --- a/helpers.sh +++ b/helpers.sh @@ -75,7 +75,7 @@ function repo_sync { git config --global http.https://${domain}/factories.extraheader "$(cat /secrets/git.http.extraheader)" fi for i in $(seq 4); do - run repo init --repo-rev=v2.35 --no-clone-bundle -u $* ${REPO_INIT_OVERRIDES} && break + run repo init --depth=1 --repo-rev=v2.35 --no-clone-bundle -u $* ${REPO_INIT_OVERRIDES} && break status "repo init failed with error $?" [ $i -eq 4 ] && exit 1 status "sleeping and trying again" @@ -93,6 +93,18 @@ function repo_sync { exit $? fi done + # NOTE: we need a shallow copy of all the repos, but a deep copy of + # lmp-manifests so we can include the LmP version into the build. + pushd .repo/manifests.git >/dev/null + for i in $(seq 4); do + run git fetch --unshallow && break + status "git-fetch of lmp-manifests failed with error $?" + [ $i -eq 4 ] && exit 1 + status "sleeping and trying again" + sleep $(($i*2)) + done + popd + if [ -d "$archive" ] ; then status "Generating pinned manifest" repo manifest -r -o $archive/manifest.pinned.xml