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) {