@@ -181,25 +181,25 @@ class GitRepository(BaseRepository):
# create a password manager
passmgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
passmgr.add_password(*authinfo)
handlers.extend((mercurial.url.httpbasicauthhandler(passmgr),
mercurial.url.httpdigestauthhandler(passmgr)))
o = urllib.request.build_opener(*handlers)
o.addheaders = [('User-Agent', 'git/1.7.8.0')] # fake some git
req = urllib.request.Request(
"%s?%s" % (
test_uri,
safe_str(test_uri),
urllib.parse.urlencode({"service": 'git-upload-pack'})
))
try:
resp = o.open(req)
if resp.code != 200:
raise Exception('Return Code is not 200')
except Exception as e:
# means it cannot be cloned
raise urllib.error.URLError("[%s] org_exc: %s" % (cleaned_uri, e))
# now detect if it's proper git repo
Status change: