From 3a2253bc153d408bc48d343b522b6160ae1f85fb Mon Sep 17 00:00:00 2001
From: Esben Haabendal <esben.haabendal@huawei.com>
Date: Wed, 13 Jul 2022 18:37:59 +0200
Subject: [PATCH] CI: Allow use with shallow clone CI setup

Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
---
 .gitlab-ci.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6797d49a..a610ea3d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -77,6 +77,10 @@ stages:
     # something like that... Without this we get errors like
     #     fatal: couldn't find remote ref refs/heads/master
     - git checkout -b master
+    # The repo command does not like shallow repos
+    - if [ "$(git rev-parse --is-shallow-repository)" = "true" ] ; then
+        git fetch --unshallow ;
+      fi
     # Create/maintain a mirror of all manifest repositories in runner
     # persistent storage, and use that as reference when initializing the
     # build repo, effectively reducing the time spent fetching git repos to
-- 
GitLab