diff options
| -rw-r--r-- | git_config.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/git_config.py b/git_config.py index 2270200c..a294a0b6 100644 --- a/git_config.py +++ b/git_config.py | |||
| @@ -596,14 +596,11 @@ class Remote(object): | |||
| 596 | try: | 596 | try: |
| 597 | info_url = u + 'ssh_info' | 597 | info_url = u + 'ssh_info' |
| 598 | info = urllib.request.urlopen(info_url).read() | 598 | info = urllib.request.urlopen(info_url).read() |
| 599 | if '<' in info: | 599 | if info == 'NOT_AVAILABLE' or '<' in info: |
| 600 | # Assume the server gave us some sort of HTML | 600 | # If `info` contains '<', we assume the server gave us some sort |
| 601 | # response back, like maybe a login page. | 601 | # of HTML response back, like maybe a login page. |
| 602 | # | 602 | # |
| 603 | raise UploadError('%s: Cannot parse response' % info_url) | 603 | # Assume HTTP if SSH is not enabled or ssh_info doesn't look right. |
| 604 | |||
| 605 | if info == 'NOT_AVAILABLE': | ||
| 606 | # Assume HTTP if SSH is not enabled. | ||
| 607 | self._review_url = http_url + 'p/' | 604 | self._review_url = http_url + 'p/' |
| 608 | else: | 605 | else: |
| 609 | host, port = info.split() | 606 | host, port = info.split() |
