diff options
author | Mauro Queirós <maurofrqueiros@gmail.com> | 2020-05-29 11:06:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-30 13:27:35 +0100 |
commit | 4fa67c2af830035a1ddedc14592ee25a15ebff22 (patch) | |
tree | 03f262064823b0184984246dfd8dfa3460b41c25 /lib | |
parent | 45028dfda5a29a34ab408cb3f11d72ae17963340 (diff) | |
download | bitbake-4fa67c2af830035a1ddedc14592ee25a15ebff22.tar.gz |
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.
Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch2/git.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index eab76a10a..dbf871567 100644 --- a/lib/bb/fetch2/git.py +++ b/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: |