From d64809679436e9338555ef4e75ea6def93fc09c3 Mon Sep 17 00:00:00 2001 From: Mauro Queirós Date: Fri, 29 May 2020 11:06:09 +0100 Subject: bitbake: git.py: Use the correct branch to check if the repository has LFS objects. Function "contains_lfs" was only looking at the master branch when searching for LFS content. LFS may be configured in specific branches only, so we need to use the correct branch. (Bitbake rev: 4fa67c2af830035a1ddedc14592ee25a15ebff22) Signed-off-by: Mauro Queiros Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/fetch2/git.py') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index eab76a10ad..dbf8715674 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -566,8 +566,15 @@ class Git(FetchMethod): """ Check if the repository has 'lfs' (large file) content """ - cmd = "%s grep lfs HEAD:.gitattributes | wc -l" % ( - ud.basecmd) + + if not ud.nobranch: + branchname = ud.branches[ud.names[0]] + else: + branchname = "master" + + cmd = "%s grep lfs origin/%s:.gitattributes | wc -l" % ( + ud.basecmd, ud.branches[ud.names[0]]) + try: output = runfetchcmd(cmd, d, quiet=True, workdir=wd) if int(output) > 0: -- cgit v1.2.3-54-g00ecf