summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2016-05-23 13:35:49 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-03 13:13:30 +0100
commit08c6808d01a3d5cde26cb7efcaf19603e6f806a6 (patch)
tree47ad846b5df6dc2772d51a2ca7b788a26dbac662 /bitbake/lib/bb/fetch2/git.py
parent2660ddeb2d47bede562136cbb62b0495b4e1e1c5 (diff)
downloadpoky-08c6808d01a3d5cde26cb7efcaf19603e6f806a6.tar.gz
bitbake: fetch2/git.py: References must match exactly
Previously the code used to match a reference to its SHA-1 in _latest_revision() used the Python "in" operator, which made it match if the reference matched the beginning of an existing tag or branch. This test, however, must be exact. I.e., either the reference matches a tag or branch exactly, or it does not match at all. (Bitbake rev: e5986c78a6108fd7578989c20efcbf0b81c97e03) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 526668bc23..59827e304f 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -350,9 +350,10 @@ class Git(FetchMethod):
350 head = "refs/heads/%s" % ud.unresolvedrev[name] 350 head = "refs/heads/%s" % ud.unresolvedrev[name]
351 tag = "refs/tags/%s" % ud.unresolvedrev[name] 351 tag = "refs/tags/%s" % ud.unresolvedrev[name]
352 for s in [head, tag + "^{}", tag]: 352 for s in [head, tag + "^{}", tag]:
353 for l in output.split('\n'): 353 for l in output.strip().split('\n'):
354 if s in l: 354 sha1, ref = l.split()
355 return l.split()[0] 355 if s == ref:
356 return sha1
356 raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \ 357 raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \
357 (ud.unresolvedrev[name], ud.host+ud.path)) 358 (ud.unresolvedrev[name], ud.host+ud.path))
358 359