bitbake: fetch/git: always fetch lfs when creating shallow tarball

Before fast shallow tarballs the shallow tarball with lfs worked only
if the original .../downloads/git2/... directory existed. Once it was
not there, do_unpack on shallow tarball without lfs files failed due to
disabled network.
It was fixed for fast shallow tarballs and this commit fixes the other
scenarios, too.

This can happen when such shallow tarball is put to mirror or if
someone does cleanup to reclaim disk space.

(Bitbake rev: 4e6fb31a88448cdacf4e9f84cf0a8a8035f84d63)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Marko 2025-04-04 20:59:10 +02:00 committed by Richard Purdie
parent 1def15acc2
commit d1dae30b79

View File

@ -634,9 +634,8 @@ class Git(FetchMethod):
runfetchcmd(fetch_cmd, d, workdir=dest) runfetchcmd(fetch_cmd, d, workdir=dest)
runfetchcmd("%s update-ref %s %s" % (ud.basecmd, ref, revision), d, workdir=dest) runfetchcmd("%s update-ref %s %s" % (ud.basecmd, ref, revision), d, workdir=dest)
# Fetch Git LFS data for fast shallow clones # Fetch Git LFS data
if not ud.shallow_skip_fast: self.lfs_fetch(ud, d, dest, ud.revision)
self.lfs_fetch(ud, d, dest, ud.revision)
# Apply extra ref wildcards # Apply extra ref wildcards
all_refs_remote = runfetchcmd("%s ls-remote origin 'refs/*'" % ud.basecmd, \ all_refs_remote = runfetchcmd("%s ls-remote origin 'refs/*'" % ud.basecmd, \