@@ -16,7 +16,7 @@ const invalid = [
16
16
'user:[email protected] :foo/bar/baz.git' ,
17
17
'user:[email protected] :foo/bar/baz.git#branch' ,
18
18
':[email protected] :foo/bar/baz.git' ,
19
- ':[email protected] :foo/bar/baz.git#branch' ,
19
+ ':[email protected] :foo/bar/baz.git#branch'
20
20
]
21
21
22
22
const defaults = { type : 'gitlab' , user : 'foo' , project : 'bar' }
@@ -95,10 +95,10 @@ const valid = {
95
95
'git+ssh://gitlab.com:foo/bar.git#branch' : { ...defaults , default : 'sshurl' , committish : 'branch' } ,
96
96
'git+ssh://[email protected] :foo/bar.git' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
97
97
'git+ssh://[email protected] :foo/bar.git#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
98
- 'git+ssh://user:[email protected] :foo/bar' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
99
- 'git+ssh://user:[email protected] :foo/bar#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
100
- 'git+ssh://:[email protected] :foo/bar' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
101
- 'git+ssh://:[email protected] :foo/bar#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
98
+ 'git+ssh://user:[email protected] :foo/bar.git ' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
99
+ 'git+ssh://user:[email protected] :foo/bar.git #branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
100
+ 'git+ssh://:[email protected] :foo/bar.git ' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
101
+ 'git+ssh://:[email protected] :foo/bar.git #branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
102
102
103
103
'git+ssh://gitlab.com:foo/bar/baz' : { ...defaults , default : 'sshurl' } ,
104
104
'git+ssh://gitlab.com:foo/bar/baz#branch' : { ...defaults , default : 'sshurl' , committish : 'branch' } ,
@@ -135,10 +135,10 @@ const valid = {
135
135
'ssh://gitlab.com:foo/bar.git#branch' : { ...defaults , default : 'sshurl' , committish : 'branch' } ,
136
136
'ssh://[email protected] :foo/bar.git' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
137
137
'ssh://[email protected] :foo/bar.git#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
138
- 'ssh://user:[email protected] :foo/bar' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
139
- 'ssh://user:[email protected] :foo/bar#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
140
- 'ssh://:[email protected] :foo/bar' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
141
- 'ssh://:[email protected] :foo/bar#branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
138
+ 'ssh://user:[email protected] :foo/bar.git ' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
139
+ 'ssh://user:[email protected] :foo/bar.git #branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
140
+ 'ssh://:[email protected] :foo/bar.git ' :
{ ...
defaults , default :
'sshurl' , auth :
null } ,
141
+ 'ssh://:[email protected] :foo/bar.git #branch' :
{ ...
defaults , default :
'sshurl' , auth :
null , committish :
'branch' } ,
142
142
143
143
'ssh://gitlab.com:foo/bar/baz' : { ...defaults , default : 'sshurl' } ,
144
144
'ssh://gitlab.com:foo/bar/baz#branch' : { ...defaults , default : 'sshurl' , committish : 'branch' } ,
@@ -236,7 +236,7 @@ const valid = {
236
236
'https://user:[email protected] /foo/bar/baz.git' :
{ ...
defaults , default :
'https' , auth :
'user:password' } ,
237
237
'https://user:[email protected] /foo/bar/baz.git#branch' :
{ ...
defaults , default :
'https' , auth :
'user:password' , committish :
'branch' } ,
238
238
'https://:[email protected] /foo/bar/baz.git' :
{ ...
defaults , default :
'https' , auth :
':password' } ,
239
- 'https://:[email protected] /foo/bar/baz.git#branch' :
{ ...
defaults , default :
'https' , auth :
':password' , committish :
'branch' } ,
239
+ 'https://:[email protected] /foo/bar/baz.git#branch' :
{ ...
defaults , default :
'https' , auth :
':password' , committish :
'branch' }
240
240
}
241
241
242
242
t . test ( 'valid urls parse properly' , t => {
@@ -287,7 +287,6 @@ t.test('string methods populate correctly', t => {
287
287
288
288
t . equal ( parsed . docs ( { committish : 'fix/bug' } ) , 'https://gitlab.com/foo/bar/tree/fix%2Fbug#readme' , 'allows overriding options' )
289
289
290
-
291
290
const extra = HostedGit . fromUrl ( 'https://[email protected] /foo/bar#fix/bug' )
292
291
t . equal ( extra . hash ( ) , '#fix/bug' , 'hash() returns a hash plus the committish when set' )
293
292
t . equal ( extra . https ( ) , 'git+https://[email protected] /foo/bar.git#fix/bug' , 'https() includes auth when set' )
0 commit comments