[bitbake-devel] [PATCH] fetch2/git: Allow other namespaces than refs/heads to be searched.
Fredrik Svensson
fredrik.svensson at axis.com
Mon Nov 3 14:53:52 UTC 2014
This makes it possble to fetch Gerrit review references which are
normally stored under refs/changes.
Signed-off-by: Fredrik Svensson <fredrik.svensson at axis.com>
---
lib/bb/fetch2/git.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 799fb6c..7d9fe7e 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^{}" % 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]
--
1.7.10.4
More information about the bitbake-devel
mailing list