summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py25
1 files changed, 1 insertions, 24 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 9b2ad455c9..11cda2007d 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -482,30 +482,7 @@ class Git(FetchMethod):
482 raise bb.fetch2.FetchError("Unable to find revision %s even from upstream" % missing_rev) 482 raise bb.fetch2.FetchError("Unable to find revision %s even from upstream" % missing_rev)
483 483
484 if self.lfs_need_update(ud, d): 484 if self.lfs_need_update(ud, d):
485 # Unpack temporary working copy, use it to run 'git checkout' to force pre-fetching 485 self.lfs_fetch(ud, d, ud.clonedir, ud.revision)
486 # of all LFS blobs needed at the srcrev.
487 #
488 # It would be nice to just do this inline here by running 'git-lfs fetch'
489 # on the bare clonedir, but that operation requires a working copy on some
490 # releases of Git LFS.
491 with tempfile.TemporaryDirectory(dir=d.getVar('DL_DIR')) as tmpdir:
492 # Do the checkout. This implicitly involves a Git LFS fetch.
493 Git.unpack(self, ud, tmpdir, d)
494
495 # Scoop up a copy of any stuff that Git LFS downloaded. Merge them into
496 # the bare clonedir.
497 #
498 # As this procedure is invoked repeatedly on incremental fetches as
499 # a recipe's SRCREV is bumped throughout its lifetime, this will
500 # result in a gradual accumulation of LFS blobs in <ud.clonedir>/lfs
501 # corresponding to all the blobs reachable from the different revs
502 # fetched across time.
503 #
504 # Only do this if the unpack resulted in a .git/lfs directory being
505 # created; this only happens if at least one blob needed to be
506 # downloaded.
507 if os.path.exists(os.path.join(ud.destdir, ".git", "lfs")):
508 runfetchcmd("tar -cf - lfs | tar -xf - -C %s" % ud.clonedir, d, workdir="%s/.git" % ud.destdir)
509 486
510 def lfs_fetch(self, ud, d, clonedir, revision, fetchall=False, progresshandler=None): 487 def lfs_fetch(self, ud, d, clonedir, revision, fetchall=False, progresshandler=None):
511 """Helper method for fetching Git LFS data""" 488 """Helper method for fetching Git LFS data"""