summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Svensson <fredrik.svensson@axis.com>2014-11-04 12:29:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-06 14:15:39 +0000
commitab8cbf2a71750f5ea36e218036b050857301607b (patch)
tree639f9475c616856a835ff3244451d73d70b354c9
parent0f9823adb7832c4ca3b2985391473aa6e8c22148 (diff)
downloadbitbake-ab8cbf2a71750f5ea36e218036b050857301607b.tar.gz
fetch2/git: Allow other namespaces than refs/heads to be searched.
This makes it possble to fetch Gerrit review references which are normally stored under refs/changes. Please disregard previous patch with the same topic. Signed-off-by: Fredrik Svensson <fredrik.svensson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/git.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 799fb6c0f..66a77a837 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -339,7 +339,10 @@ class Git(FetchMethod):
"""
Compute the HEAD revision for the url
"""
- search = "refs/heads/%s refs/tags/%s^{}" % (ud.unresolvedrev[name], ud.unresolvedrev[name])
+ if ud.unresolvedrev[name][:5] == "refs/":
+ search = "%s %s^{}" % (ud.unresolvedrev[name], ud.unresolvedrev[name])
+ else:
+ search = "refs/heads/%s refs/tags/%s^{}" % (ud.unresolvedrev[name], ud.unresolvedrev[name])
output = self._lsremote(ud, d, search)
return output.split()[0]