Skip to content

Commit

Permalink
Fixes gitkraken#528 - supports ~ in ssh path
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 3, 2018
1 parent 62e1696 commit 532b9c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/git/parsers/remoteParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*
Expand All @@ -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://[email protected]/project.git
ssh://[email protected]/path/to/repo.git
Expand Down

0 comments on commit 532b9c0

Please sign in to comment.