Skip to content

Commit 96cec36

Browse files
committed
cache: Handle cases where git url contains host more than once
Slight fixup for npm#3224
1 parent 54e68d4 commit 96cec36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ function archiveGitRemote (p, u, co, origUrl, cb) {
527527
var spo = origUrl.split(parsed.host)
528528
var spr = resolved.split(parsed.host)
529529
if (spo[1].charAt(0) === ':' && spr[1].charAt(0) === '/')
530-
resolved = spr[0] + parsed.host + spr[1].slice(1)
530+
spr[1] = spr[1].slice(1)
531+
resolved = spr.join(parsed.host)
531532

532533
log.verbose('resolved git url', resolved)
533534
next()

0 commit comments

Comments
 (0)