File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ 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 ( / ^ ( [ ^ : ] + ) : (?: [ ^ @ ] + @ ) ? (?: ( [ ^ / ] * ) \/ ) ? ( [ ^ # ] + ) / )
45+ // var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)'))
4546 var matches = Object . keys ( gitHosts ) . map ( function ( gitHostName ) {
4647 try {
4748 var gitHostInfo = gitHosts [ gitHostName ]
@@ -55,7 +56,7 @@ function fromUrl (giturl, opts) {
5556 var defaultRepresentation = null
5657 if ( shortcutMatch && shortcutMatch [ 1 ] === gitHostName ) {
5758 user = shortcutMatch [ 2 ] && decodeURIComponent ( shortcutMatch [ 2 ] )
58- project = decodeURIComponent ( shortcutMatch [ 3 ] )
59+ project = decodeURIComponent ( shortcutMatch [ 3 ] . replace ( / \. g i t $ / , '' ) )
5960 defaultRepresentation = 'shortcut'
6061 } else {
6162 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