mirror of
https://github.com/zhigang1992/npm.git
synced 2026-05-28 23:51:28 +08:00
@@ -520,6 +520,15 @@ function archiveGitRemote (p, u, co, origUrl, cb) {
|
||||
var parsed = url.parse(origUrl)
|
||||
parsed.hash = stdout
|
||||
resolved = url.format(parsed)
|
||||
|
||||
// https://github.com/isaacs/npm/issues/3224
|
||||
// node incorrectly sticks a / at the start of the path
|
||||
// We know that the host won't change, so split and detect this
|
||||
var spo = origUrl.split(parsed.host)
|
||||
var spr = resolved.split(parsed.host)
|
||||
if (spo[1].charAt(0) === ':' && spr[1].charAt(0) === '/')
|
||||
resolved = spr[0] + parsed.host + spr[1].slice(1)
|
||||
|
||||
log.verbose('resolved git url', resolved)
|
||||
next()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user