summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPhilip Lorenz <philip.lorenz@bmw.de>2025-04-29 10:11:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-05-08 11:37:32 +0100
commit74945e467895d6dd444f7ccf8d2a41eac63604ae (patch)
treef5ea608c6230a9587c1aaed42ed51a6cf39e12c3 /bitbake
parent7642477dc8550eeff75d34bd3bbdf574e2f5687c (diff)
downloadpoky-74945e467895d6dd444f7ccf8d2a41eac63604ae.tar.gz
bitbake: fetch2: Simplify git LFS detection
Its unclear why this function does not operate on the desired source revision to begin with (which really should be the decider on whether a particular source revision uses LFS or not). Simplify the decision logic by always checking the `.gitattributes` file of the target revision. (Bitbake rev: b3faa0ce5c0a6945f26b5b303a7f38c00d132397) Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/git.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 9e58337359..9b2ad455c9 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -845,18 +845,8 @@ class Git(FetchMethod):
845 """ 845 """
846 Check if the repository has 'lfs' (large file) content 846 Check if the repository has 'lfs' (large file) content
847 """ 847 """
848
849 if ud.nobranch:
850 # If no branch is specified, use the current git commit
851 refname = ud.revision
852 elif wd == ud.clonedir:
853 # The bare clonedir doesn't use the remote names; it has the branch immediately.
854 refname = ud.branch
855 else:
856 refname = "origin/%s" % ud.branch
857
858 cmd = "%s grep lfs %s:.gitattributes | wc -l" % ( 848 cmd = "%s grep lfs %s:.gitattributes | wc -l" % (
859 ud.basecmd, refname) 849 ud.basecmd, ud.revision)
860 850
861 try: 851 try:
862 output = runfetchcmd(cmd, d, quiet=True, workdir=wd) 852 output = runfetchcmd(cmd, d, quiet=True, workdir=wd)