File tree 1 file changed +15
-7
lines changed
src/common_modules/vsts-cli-common/vsts/cli/common
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import logging
8
8
9
-
10
9
from msrest .serialization import Model
11
10
from .file_cache import get_cli_cache
12
11
from .uri import uri_parse
@@ -64,6 +63,8 @@ def get_vsts_info(remote_url):
64
63
if components .scheme == 'ssh' :
65
64
# Convert to https url.
66
65
netloc = VstsGitUrlInfo .convert_ssh_netloc_to_https_netloc (components .netloc )
66
+ if netloc is None :
67
+ return None
67
68
uri = 'https://' + netloc + '/' + components .path
68
69
ssh_path_segment = '_ssh/'
69
70
ssh_path_segment_pos = uri .find (ssh_path_segment )
@@ -78,12 +79,19 @@ def get_vsts_info(remote_url):
78
79
def convert_ssh_netloc_to_https_netloc (netloc ):
79
80
if netloc is None :
80
81
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
87
95
88
96
@staticmethod
89
97
def is_vsts_url_candidate (url ):
You can’t perform that action at this time.
0 commit comments