Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Allow :/ in remote URL #2086

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/models/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions test/models/remote.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down