aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Queirós <maurofrqueiros@gmail.com>2021-02-03 04:22:08 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-05 12:18:26 +0000
commit274f790ac9161187810df3242d3570261e407b11 (patch)
tree8b3dcfac85c08f01400695373350119c20461927
parent2795c6150c0b3218716195c0d10ff2843b1ef695 (diff)
downloadbitbake-274f790ac9161187810df3242d3570261e407b11.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> (cherry picked from commit 4fa67c2af830035a1ddedc14592ee25a15ebff22) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/git.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index bdbfe5c00..07064c694 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: