File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 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) {
4141 isGitHubShorthand ( giturl ) ? 'github:' + giturl : giturl
4242 )
4343 var parsed = parseGitUrl ( url )
44- var shortcutMatch = url . match ( new RegExp ( ' ^([^:]+):(?:(?: [^@:]+(?:[^@]+)?@)? ([^/]*))[/](.+?)(?:[.]git)?($|#)' ) )
44+ var shortcutMatch = url . match ( / ^ ( [ ^ : ] + ) : (?: [ ^ @ ] + @ ) ? (?: ( [ ^ / ] * ) \/ ) ? ( [ ^ # ] + ) / )
4545 var matches = Object . keys ( gitHosts ) . map ( function ( gitHostName ) {
4646 try {
4747 var gitHostInfo = gitHosts [ gitHostName ]
@@ -55,7 +55,7 @@ function fromUrl (giturl, opts) {
5555 var defaultRepresentation = null
5656 if ( shortcutMatch && shortcutMatch [ 1 ] === gitHostName ) {
5757 user = shortcutMatch [ 2 ] && decodeURIComponent ( shortcutMatch [ 2 ] )
58- project = decodeURIComponent ( shortcutMatch [ 3 ] )
58+ project = decodeURIComponent ( shortcutMatch [ 3 ] . replace ( / \. g i t $ / , '' ) )
5959 defaultRepresentation = 'shortcut'
6060 } else {
6161 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