File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
src/common_modules/vsts-cli-common/vsts/cli/common Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 66
77import logging
88
9-
109from msrest .serialization import Model
1110from .file_cache import get_cli_cache
1211from .uri import uri_parse
@@ -64,6 +63,8 @@ def get_vsts_info(remote_url):
6463 if components .scheme == 'ssh' :
6564 # Convert to https url.
6665 netloc = VstsGitUrlInfo .convert_ssh_netloc_to_https_netloc (components .netloc )
66+ if netloc is None :
67+ return None
6768 uri = 'https://' + netloc + '/' + components .path
6869 ssh_path_segment = '_ssh/'
6970 ssh_path_segment_pos = uri .find (ssh_path_segment )
@@ -78,12 +79,19 @@ def get_vsts_info(remote_url):
7879 def convert_ssh_netloc_to_https_netloc (netloc ):
7980 if netloc is None :
8081 return None
81- import re
82- regex = re .compile ('([^@]+)@[^\.]+(\.[^:]+)' )
83- match = regex .match (netloc )
84- if match is not None :
85- return match .group (1 ) + match .group (2 )
86- return None
82+ if netloc .find ('@' ) < 0 :
83+ # on premise url
84+ logging .warning ('TFS SSH URLs are not supported for repo auto-detection yet. See the following issue for ' +
85+ 'latest updates: https://github.com/Microsoft/vsts-cli/issues/142' )
86+ return None
87+ else :
88+ # hosted url
89+ import re
90+ regex = re .compile ('([^@]+)@[^\.]+(\.[^:]+)' )
91+ match = regex .match (netloc )
92+ if match is not None :
93+ return match .group (1 ) + match .group (2 )
94+ return None
8795
8896 @staticmethod
8997 def is_vsts_url_candidate (url ):
You can’t perform that action at this time.
0 commit comments