mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Fixes #87 - Can't open files in remote when using git@ urls (ssh)
This commit is contained in:
@@ -15,7 +15,7 @@ const providerMap = new Map<string, (domain: string, path: string) => RemoteProv
|
|||||||
['visualstudio.com', (domain: string, path: string) => new VisualStudioService(domain, path)]
|
['visualstudio.com', (domain: string, path: string) => new VisualStudioService(domain, path)]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const UrlRegex = /^(?:git:\/\/(.*?)\/|https:\/\/(.*?)\/|http:\/\/(.*?)\/|git@(.*):\/\/|ssh:\/\/git@(.*?)\/)(.*)$/;
|
const UrlRegex = /^(?:git:\/\/(.*?)\/|https:\/\/(.*?)\/|http:\/\/(.*?)\/|git@(.*):|ssh:\/\/(?:.*@)?(.*?)(?::.*?)?\/)(.*)$/;
|
||||||
|
|
||||||
export class RemoteProviderFactory {
|
export class RemoteProviderFactory {
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ export class RemoteProviderFactory {
|
|||||||
if (match == null) return undefined;
|
if (match == null) return undefined;
|
||||||
|
|
||||||
const domain = match[1] || match[2] || match[3] || match[4] || match[5];
|
const domain = match[1] || match[2] || match[3] || match[4] || match[5];
|
||||||
const path = match[6].replace(/\.git/, '');
|
const path = match[6].replace(/\.git\/?$/, '');
|
||||||
|
|
||||||
const key = domain.toLowerCase().endsWith('visualstudio.com')
|
const key = domain.toLowerCase().endsWith('visualstudio.com')
|
||||||
? 'visualstudio.com'
|
? 'visualstudio.com'
|
||||||
|
|||||||
Reference in New Issue
Block a user