Fix SSH URL parsing for URLs with custom ports
As pointed out by @yajoman in #611 (closed) (See this comment: #611 (comment 1154175809)), the fix for #611 (closed) was not sufficient and in fact wrong for URLs without URL schemes. Furthermore, custom ports in SSH URLs with a URL scheme are not properly handled at all.
This MR extends the support to three kinds of URLs:
-
[git@example.com:2222]:fatihacet/gitlab-vscode-extension.git
, which is interpreted as hostexample.com
, port2222
and the pathfatihacet/gitlab-vscode-extension.git
-
ssh://git@example.com:2222/fatihacet/gitlab-vscode-extension.git
, which is interpreted as hostexample.com
, port2222
and the pathfatihacet/gitlab-vscode-extension.git
-
git@example.com:2222/fatihacet/gitlab-vscode-extension.git
, which is interpreted as hostexample.com
, default port (22) and the path2222/fatihacet/gitlab-vscode-extension.git
Relates to #611 (closed), #644
Edited by Johannes May