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 aeschright committed Jan 9, 2019
1 parent ab0f026 commit 56aceac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/shrinkwrap.js
Original file line number Diff line number Diff line change
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 56aceac

Please # to comment.