Skip to content

Commit

Permalink
Handle git branch references correctly (#123)
Browse files Browse the repository at this point in the history
PR-URL: #123
Credit: @johanneswuerbach
Reviewed-By: @aeschright
  • Loading branch information
johanneswuerbach authored and Audrey Eschright committed Jan 9, 2019
1 parent 41f1552 commit c5b6056
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/shrinkwrap.js
Expand Up @@ -167,6 +167,8 @@ function childVersion (top, child, req) {
function childRequested (top, child, requested) {
if (requested.type === 'directory' || requested.type === 'file') {
return 'file:' + unixFormatPath(path.relative(top.path, child.package._resolved || requested.fetchSpec))
} else if (requested.type === 'git' && child.package._from) {
return child.package._from
} else if (!isRegistry(requested) && !child.fromBundle) {
return child.package._resolved || requested.saveSpec || requested.rawSpec
} else if (requested.type === 'tag') {
Expand Down

0 comments on commit c5b6056

Please sign in to comment.