Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit 0e1726c

Browse files
committed
deps: Now that from is in the lockfile, tighten git matching
1 parent 171f318 commit 0e1726c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

lib/install/deps.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ function doesChildVersionMatch (child, requested, requestor) {
5252
}
5353

5454
if (requested.type === 'git' && child.fromShrinkwrap) {
55-
const fromSw = child.fromShrinkwrap
56-
57-
if (fromSw.rawSpec === requested.rawSpec) return true
58-
59-
if (!fromSw.hosted || !requested.hosted) return false
60-
61-
return fromSw.hosted.toString() === requested.hosted.toString()
55+
const fromSw = child.package._from ? npa(child.package._from) : child.fromShrinkwrap
56+
fromSw.name = requested.name // we're only checking specifiers here
57+
if (fromSw.toString() === requested.toString()) return true
6258
}
6359

6460
if (!registryTypes[requested.type]) {

0 commit comments

Comments
 (0)