From dfe9646f3d917d20d4f594b3ae976c858ac422fd Mon Sep 17 00:00:00 2001 From: Travis Beck Date: Thu, 18 Apr 2019 20:18:08 -0700 Subject: [PATCH] Allow :/ in remote --- lib/models/remote.js | 2 +- test/models/remote.test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/models/remote.js b/lib/models/remote.js index a5a441b8db..f9c5dd06ee 100644 --- a/lib/models/remote.js +++ b/lib/models/remote.js @@ -73,7 +73,7 @@ function githubInfoFromRemote(remoteUrl) { } // proto login domain owner repo - const regex = /(?:(.+):\/\/)?(?:.+@)?(github\.com)[:/]([^/]+)\/(.+)/; + const regex = /(?:(.+):\/\/)?(?:.+@)?(github\.com)[:/]\/?([^/]+)\/(.+)/; const match = remoteUrl.match(regex); if (match) { return { diff --git a/test/models/remote.test.js b/test/models/remote.test.js index ce39859bc1..410c660e18 100644 --- a/test/models/remote.test.js +++ b/test/models/remote.test.js @@ -4,11 +4,13 @@ describe('Remote', function() { it('detects and extracts information from GitHub repository URLs', function() { const urls = [ ['git@github.com:atom/github.git', 'ssh'], + ['git@github.com:/atom/github.git', 'ssh'], ['https://github.com/atom/github.git', 'https'], ['https://git:pass@github.com/atom/github.git', 'https'], ['ssh+https://github.com/atom/github.git', 'ssh+https'], ['git://github.com/atom/github', 'git'], ['ssh://git@github.com:atom/github.git', 'ssh'], + ['ssh://git@github.com:/atom/github.git', 'ssh'], ]; for (const [url, proto] of urls) {