fetch2/git: Allow other namespaces than refs/heads to be searched.
PATCH 1/1 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 <[email protected]>
--- lib/bb/fetch2/git.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/git.py +4 -1
@@ -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]
Signature · 1 line
1.7.10.4