summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorPhilip Lorenz <philip.lorenz@bmw.de>2025-04-29 10:11:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-08 11:37:32 +0100
commit3eeac69385e8f29a08d022a17b28b5d504deed66 (patch)
tree4879e7e6dd9e7579d4d731cd1953cf363332c627 /bitbake/lib
parenteb6d89e9e6f27b683da6f2ba2227707a965a0094 (diff)
downloadpoky-3eeac69385e8f29a08d022a17b28b5d504deed66.tar.gz
bitbake: fetch2: Fix LFS object checkout in submodules
Skipping smudging prevents the LFS objects from replacing their placeholder files when `git submodule update` actually checks out the target revision in the submodule. Smudging cannot happen earlier as the clone stored in `.git/modules` is bare. This should be fine as long as all LFS objects are available in the download cache (which they are after the other fixes are applied). (Bitbake rev: d270e33a07c50bb9c08861cf9a6dc51e1fd2d874) Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index c8bc54e6ab..5869e1b99b 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -245,12 +245,11 @@ class GitSM(Git):
245 ret = self.process_submodules(ud, ud.destdir, unpack_submodules, d) 245 ret = self.process_submodules(ud, ud.destdir, unpack_submodules, d)
246 246
247 if not ud.bareclone and ret: 247 if not ud.bareclone and ret:
248 # All submodules should already be downloaded and configured in the tree. This simply 248 cmdprefix = ""
249 # sets up the configuration and checks out the files. The main project config should 249 # Avoid LFS smudging (replacing the LFS pointers with the actual content) when LFS shouldn't be used but git-lfs is installed.
250 # remain unmodified, and no download from the internet should occur. As such, lfs smudge 250 if not self._need_lfs(ud):
251 # should also be skipped as these files were already smudged in the fetch stage if lfs 251 cmdprefix = "GIT_LFS_SKIP_SMUDGE=1 "
252 # was enabled. 252 runfetchcmd("%s%s submodule update --recursive --no-fetch" % (cmdprefix, ud.basecmd), d, quiet=True, workdir=ud.destdir)
253 runfetchcmd("GIT_LFS_SKIP_SMUDGE=1 %s submodule update --recursive --no-fetch" % (ud.basecmd), d, quiet=True, workdir=ud.destdir)
254 def clean(self, ud, d): 253 def clean(self, ud, d):
255 def clean_submodule(ud, url, module, modpath, workdir, d): 254 def clean_submodule(ud, url, module, modpath, workdir, d):
256 url += ";bareclone=1;nobranch=1" 255 url += ";bareclone=1;nobranch=1"