summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 00a459d653..c391b38039 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -106,6 +106,7 @@ class Git(FetchMethod):
106 if ud.bareclone: 106 if ud.bareclone:
107 ud.nocheckout = 1 107 ud.nocheckout = 1
108 108
109 ud.unresolvedrev = {}
109 branches = ud.parm.get("branch", "master").split(',') 110 branches = ud.parm.get("branch", "master").split(',')
110 if len(branches) != len(ud.names): 111 if len(branches) != len(ud.names):
111 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) 112 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
@@ -113,6 +114,7 @@ class Git(FetchMethod):
113 for name in ud.names: 114 for name in ud.names:
114 branch = branches[ud.names.index(name)] 115 branch = branches[ud.names.index(name)]
115 ud.branches[name] = branch 116 ud.branches[name] = branch
117 ud.unresolvedrev[name] = branch
116 118
117 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 119 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
118 120
@@ -124,7 +126,7 @@ class Git(FetchMethod):
124 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one 126 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
125 if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]): 127 if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
126 if ud.revisions[name]: 128 if ud.revisions[name]:
127 ud.branches[name] = ud.revisions[name] 129 ud.unresolvedrev[name] = ud.revisions[name]
128 ud.revisions[name] = self.latest_revision(ud, d, name) 130 ud.revisions[name] = self.latest_revision(ud, d, name)
129 131
130 gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.')) 132 gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.'))
@@ -300,7 +302,7 @@ class Git(FetchMethod):
300 """ 302 """
301 Return a unique key for the url 303 Return a unique key for the url
302 """ 304 """
303 return "git:" + ud.host + ud.path.replace('/', '.') + ud.branches[name] 305 return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
304 306
305 def _latest_revision(self, ud, d, name): 307 def _latest_revision(self, ud, d, name):
306 """ 308 """
@@ -313,7 +315,7 @@ class Git(FetchMethod):
313 315
314 basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 316 basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
315 cmd = "%s ls-remote %s://%s%s%s %s" % \ 317 cmd = "%s ls-remote %s://%s%s%s %s" % \
316 (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name]) 318 (basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
317 if ud.proto.lower() != 'file': 319 if ud.proto.lower() != 'file':
318 bb.fetch2.check_network_access(d, cmd) 320 bb.fetch2.check_network_access(d, cmd)
319 output = runfetchcmd(cmd, d, True) 321 output = runfetchcmd(cmd, d, True)