We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentafeaefd commit29adfe5Copy full SHA for 29adfe5
index.js
@@ -41,7 +41,7 @@ function fromUrl (giturl, opts) {
41
isGitHubShorthand(giturl) ?'github:'+giturl :giturl
42
)
43
varparsed=parseGitUrl(url)
44
-varshortcutMatch=url.match(newRegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)'))
+varshortcutMatch=url.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/)
45
varmatches=Object.keys(gitHosts).map(function(gitHostName){
46
try{
47
vargitHostInfo=gitHosts[gitHostName]
@@ -55,7 +55,7 @@ function fromUrl (giturl, opts) {
55
vardefaultRepresentation=null
56
if(shortcutMatch&&shortcutMatch[1]===gitHostName){
57
user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2])
58
-project=decodeURIComponent(shortcutMatch[3])
+project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,''))
59
defaultRepresentation='shortcut'
60
}else{
61
if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,'')!==gitHostInfo.domain)return