File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export class GitData {
100
100
}
101
101
102
102
if ( gitRemote . startsWith ( "http" ) ) {
103
- gitRemoteMatch = / (?< schema > h t t p s ? ) : \/ \/ (?: ( \w + ) : ( [ \w - ] + ) @ ) ? (?< host > [ ^ / : ] + ) : ? (?< port > \d + ) ? \/ (?< group > \S + ) \/ (?< project > \S + ) \. g i t / . exec ( gitRemote ) ; // regexr.com/7ve8l
103
+ gitRemoteMatch = / (?< schema > h t t p s ? ) : \/ \/ (?: ( [ ^ : ] + ) : ( [ ^ @ ] + ) @ ) ? (?< host > [ ^ / : ] + ) : ? (?< port > \d + ) ? \/ (?< group > \S + ) \/ (?< project > \S + ) \. g i t / . exec ( gitRemote ) ; // regexr.com/7ve8l
104
104
assert ( gitRemoteMatch ?. groups != null , "git remote get-url origin didn't provide valid matches" ) ;
105
105
106
106
let port = "443" ;
Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ const tests = [
74
74
project : "package" ,
75
75
} ,
76
76
} ,
77
+ {
78
+ input :
"https://username-with-dashes:[email protected] :8080/vendor/package.git" ,
79
+ expected : {
80
+ schema : "https" ,
81
+ port : "8080" ,
82
+ host : "somegitlab.com" ,
83
+ group : "vendor" ,
84
+ project : "package" ,
85
+ } ,
86
+ } ,
77
87
{
78
88
input : "https://example.com:8443/1/2/3package.git" ,
79
89
expected : {
You can’t perform that action at this time.
0 commit comments