Commit 6791134a by Baodong Chen

fix "repo sync" error when inited with user@host:port

example
repo init -u git@192.168.2.34:hd/mxivi/manifests.git
repo sync
sync will fail becasue url is wrong and got
Access denied
parent 09f5180b
......@@ -94,8 +94,11 @@ class _XmlRemote(object):
# and then replacing it with the original when we are done.
if manifestUrl.find(':') != manifestUrl.find('/') - 1:
if url.find(':') != url.find('/') - 1:
url = 'gopher://' + url
url = urllib.parse.urljoin('gopher://' + manifestUrl, url)
url = re.sub(r'^gopher://', '', url)
else:
url = urllib.parse.urljoin(manifestUrl, url)
return url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment