From 532b9c01c7b0afdec144d00a0b939369e5a1d337 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 3 Dec 2018 10:31:37 -0500 Subject: [PATCH] Fixes #528 - supports ~ in ssh path --- src/git/parsers/remoteParser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/git/parsers/remoteParser.ts b/src/git/parsers/remoteParser.ts index 9c56854..784a5dd 100644 --- a/src/git/parsers/remoteParser.ts +++ b/src/git/parsers/remoteParser.ts @@ -4,7 +4,7 @@ import { RemoteProvider } from '../remotes/factory'; import { GitRemote } from './../git'; const remoteRegex = /^(.*)\t(.*)\s\((.*)\)$/gm; -const urlRegex = /^(?:(git:\/\/)(.*?)\/|(https?:\/\/)(?:.*?@)?(.*?)\/|git@(.*):|(ssh:\/\/)(?:.*@)?(.*?)(?::.*?)?\/|(?:.*?@)(.*?):)(.*)$/; +const urlRegex = /^(?:(git:\/\/)(.*?)\/|(https?:\/\/)(?:.*?@)?(.*?)\/|git@(.*):|(ssh:\/\/)(?:.*@)?(.*?)(?::.*?)?(?:\/|(?=~))|(?:.*?@)(.*?):)(.*)$/; // Test git urls /* @@ -26,6 +26,7 @@ git://host.xz/~user/path/to/repo.git/ ssh://host.xz/project.git ssh://host.xz/path/to/repo.git ssh://host.xz/path/to/repo.git/ +ssh://host.xz:~project.git ssh://host.xz:port/path/to/repo.git/ ssh://user@host.xz/project.git ssh://user@host.xz/path/to/repo.git