File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ function fromUrl (giturl, opts) {
41
41
isGitHubShorthand ( giturl ) ? 'github:' + giturl : giturl
42
42
)
43
43
var parsed = parseGitUrl ( url )
44
- var shortcutMatch = url . match ( new RegExp ( ' ^([^:]+):(?:(?: [^@:]+(?:[^@]+)?@)? ([^/]*))[/](.+?)(?:[.]git)?($|#)' ) )
44
+ var shortcutMatch = url . match ( / ^ ( [ ^ : ] + ) : (?: [ ^ @ ] + @ ) ? (?: ( [ ^ / ] * ) \/ ) ? ( [ ^ # ] + ) / )
45
45
var matches = Object . keys ( gitHosts ) . map ( function ( gitHostName ) {
46
46
try {
47
47
var gitHostInfo = gitHosts [ gitHostName ]
@@ -55,7 +55,7 @@ function fromUrl (giturl, opts) {
55
55
var defaultRepresentation = null
56
56
if ( shortcutMatch && shortcutMatch [ 1 ] === gitHostName ) {
57
57
user = shortcutMatch [ 2 ] && decodeURIComponent ( shortcutMatch [ 2 ] )
58
- project = decodeURIComponent ( shortcutMatch [ 3 ] )
58
+ project = decodeURIComponent ( shortcutMatch [ 3 ] . replace ( / \. g i t $ / , '' ) )
59
59
defaultRepresentation = 'shortcut'
60
60
} else {
61
61
if ( parsed . host && parsed . host !== gitHostInfo . domain && parsed . host . replace ( / ^ w w w [ . ] / , '' ) !== gitHostInfo . domain ) return
You can’t perform that action at this time.
0 commit comments