Skip to content

Commit b228669

Browse files
committed
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 <andy@foundries.io>
1 parent 36fd15a commit b228669

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

helpers.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function repo_sync {
7575
git config --global http.https://${domain}/factories.extraheader "$(cat /secrets/git.http.extraheader)"
7676
fi
7777
for i in $(seq 4); do
78-
run repo init --repo-rev=v2.35 --no-clone-bundle -u $* ${REPO_INIT_OVERRIDES} && break
78+
run repo init --depth=1 --repo-rev=v2.35 --no-clone-bundle -u $* ${REPO_INIT_OVERRIDES} && break
7979
status "repo init failed with error $?"
8080
[ $i -eq 4 ] && exit 1
8181
status "sleeping and trying again"
@@ -93,6 +93,18 @@ function repo_sync {
9393
exit $?
9494
fi
9595
done
96+
# NOTE: we need a shallow copy of all the repos, but a deep copy of
97+
# lmp-manifests so we can include the LmP version into the build.
98+
pushd .repo/manifests.git >/dev/null
99+
for i in $(seq 4); do
100+
run git fetch --unshallow && break
101+
status "git-fetch of lmp-manifests failed with error $?"
102+
[ $i -eq 4 ] && exit 1
103+
status "sleeping and trying again"
104+
sleep $(($i*2))
105+
done
106+
popd
107+
96108
if [ -d "$archive" ] ; then
97109
status "Generating pinned manifest"
98110
repo manifest -r -o $archive/manifest.pinned.xml

0 commit comments

Comments
 (0)