File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ const _prepareDir = Symbol('_prepareDir')
23
23
24
24
// get the repository url. prefer ssh, fall back to git://
25
25
const repoUrl = ( hosted , opts ) =>
26
- hosted . sshurl && hosted . sshurl ( opts ) ||
26
+ hosted . sshurl && addGitPlus ( hosted . sshurl ( opts ) ) ||
27
27
hosted . git && hosted . git ( opts )
28
28
29
+ const addGitPlus = url => url && `git+${ url } `
30
+
29
31
class GitFetcher extends Fetcher {
30
32
constructor ( spec , opts ) {
31
33
super ( spec , opts )
Original file line number Diff line number Diff line change @@ -396,3 +396,10 @@ t.test('fetch a private repo where the tgz is not a tarball', t => {
396
396
code : 'TAR_BAD_ARCHIVE' ,
397
397
} )
398
398
} )
399
+
400
+ t . test ( 'resolved is a git+ssh url for hosted repos that support it' , t => {
401
+ const hash = '0000000000000000000000000000000000000000'
402
+ const gf = new GitFetcher ( `github:x/y#${ hash } ` , { } )
403
+ t . equal ( gf . resolved , `git+ssh://git@github.com/x/y.git#${ hash } ` )
404
+ t . end ( )
405
+ } )
You can’t perform that action at this time.
0 commit comments