From 22728acd78d65e993215a7f94cbf692d3111a4c4 Mon Sep 17 00:00:00 2001 From: Stefan Koch Date: Mon, 3 Mar 2025 14:49:11 +0100 Subject: [PATCH] bitbake: fetch2/gitsm: Unpack even when `ud.clonedir` is not available (Bitbake rev: 13d76361ec37faecd84e7b81da22ada7d4e0ba90) Signed-off-by: Stefan Koch Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index bab1bf2580..1c58230eac 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -150,7 +150,10 @@ class GitSM(Git): def call_process_submodules(self, ud, d, extra_check, subfunc): # If we're using a shallow mirror tarball it needs to be # unpacked temporarily so that we can examine the .gitmodules file - if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: + # Unpack even when ud.clonedir is not available, + # which may occur during a fast shallow clone + unpack = extra_check or not os.path.exists(ud.clonedir) + if ud.shallow and os.path.exists(ud.fullshallow) and unpack: tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) try: runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir)