We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea9a962 commit 180c663Copy full SHA for 180c663
1 file changed
src/scm/index.js
@@ -66,10 +66,10 @@ export function detectRepoName() {
66
const origin = getOrigin();
67
if (!origin) return null;
68
// SSH: git@host:path/to/repo[.git]
69
- const sshMatch = origin.match(/^[^@]+@[^:]+:(.+?)(?:\.git)?$/);
+ const sshMatch = origin.match(/^(?:[^@]+@)?[^:]+:(.+?)(?:\.git)?$/);
70
if (sshMatch) return sshMatch[1];
71
// HTTPS: https://[user:pass@]host/path/to/repo[.git]
72
- const httpsMatch = origin.match(/^https?:\/\/[^/]+\/(.+?)(?:\.git)?$/);
+ const httpsMatch = origin.match(/^(?:https?|git):\/\/[^/]+\/(.+?)(?:\.git)?$/);
73
if (httpsMatch) return httpsMatch[1];
74
return null;
75
}
0 commit comments