diff options
author | Desone Burns <dburns@seegrid.com> | 2023-11-03 11:45:49 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-23 17:37:25 +0000 |
commit | 7aab731f1eea76d84ebe8e44e9517cbfc30fa455 (patch) | |
tree | c6e658a8860314781828ff3534fc71565f4b64c9 /bitbake/lib/bb/fetch2/git.py | |
parent | 6a87f5d53b52422f4a1e12f945495ed9951f7676 (diff) | |
download | poky-7aab731f1eea76d84ebe8e44e9517cbfc30fa455.tar.gz |
bitbake: bitbake: fetch2: git: Update Git-LFS download and tests
When downloading a Git repository containing an LFS, the Git hooks
are not always initialized correctly to perform the download. This
change updates the Git downloader to run the "git lfs install" command
in order to "smudge" the LFS files. The tests have also been updated
to do checks for situations in which git lfs is not installed, as
the application was required to be installed for any of the tests
to run previously.
The Git LFS functionality was working to some degree previously,
but this change also updates the fetcher to allow LFS downloads for
nobranch SRC_URIs.
(Bitbake rev: 05f8529fb439db93d85a892704b6f2f0ac0c9217)
Signed-off-by: Desone Burns II <dburns@seegrid.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 27a0d05144..5fb573a381 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -52,6 +52,11 @@ Supported SRC_URI options are: | |||
52 | For local git:// urls to use the current branch HEAD as the revision for use with | 52 | For local git:// urls to use the current branch HEAD as the revision for use with |
53 | AUTOREV. Implies nobranch. | 53 | AUTOREV. Implies nobranch. |
54 | 54 | ||
55 | - lfs | ||
56 | Enable the checkout to use LFS for large files. This will download all LFS files | ||
57 | in the download step, as the unpack step does not have network access. | ||
58 | The default is "1", set lfs=0 to skip. | ||
59 | |||
55 | """ | 60 | """ |
56 | 61 | ||
57 | # Copyright (C) 2005 Richard Purdie | 62 | # Copyright (C) 2005 Richard Purdie |
@@ -629,6 +634,8 @@ class Git(FetchMethod): | |||
629 | raise bb.fetch2.FetchError("Repository %s has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)" % (repourl)) | 634 | raise bb.fetch2.FetchError("Repository %s has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)" % (repourl)) |
630 | elif not need_lfs: | 635 | elif not need_lfs: |
631 | bb.note("Repository %s has LFS content but it is not being fetched" % (repourl)) | 636 | bb.note("Repository %s has LFS content but it is not being fetched" % (repourl)) |
637 | else: | ||
638 | runfetchcmd("%s lfs install" % ud.basecmd, d, workdir=destdir) | ||
632 | 639 | ||
633 | if not ud.nocheckout: | 640 | if not ud.nocheckout: |
634 | if subpath: | 641 | if subpath: |
@@ -688,8 +695,11 @@ class Git(FetchMethod): | |||
688 | Check if the repository has 'lfs' (large file) content | 695 | Check if the repository has 'lfs' (large file) content |
689 | """ | 696 | """ |
690 | 697 | ||
691 | # The bare clonedir doesn't use the remote names; it has the branch immediately. | 698 | if ud.nobranch: |
692 | if wd == ud.clonedir: | 699 | # If no branch is specified, use the current git commit |
700 | refname = self._build_revision(ud, d, ud.names[0]) | ||
701 | elif wd == ud.clonedir: | ||
702 | # The bare clonedir doesn't use the remote names; it has the branch immediately. | ||
693 | refname = ud.branches[ud.names[0]] | 703 | refname = ud.branches[ud.names[0]] |
694 | else: | 704 | else: |
695 | refname = "origin/%s" % ud.branches[ud.names[0]] | 705 | refname = "origin/%s" % ud.branches[ud.names[0]] |