Skip to content

Commit

Permalink
fix(git): use the parsed git committish from npa
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 31, 2017
1 parent 62ba84d commit 77a676a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/fetchers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function hostedManifest (spec, opts) {
}

function plainManifest (repo, spec, opts) {
const rawRef = spec.gitCommittish
const rawRef = spec.gitCommittish || spec.gitRange
return resolve(
repo, rawRef, spec.name, opts
).then(ref => {
Expand Down Expand Up @@ -133,15 +133,14 @@ function plainManifest (repo, spec, opts) {
}

function resolve (url, rawRef, name, opts) {
const semverMatch = rawRef.match(/^semver:v?(.*)/)
const isSemver = semverMatch && semver.validRange(semverMatch[1])
const isSemver = semver.validRange(rawRef)
return git.revs(url, opts).then(remoteRefs => {
return isSemver
? pickManifest({
versions: remoteRefs.versions,
'dist-tags': remoteRefs['dist-tags'],
name: name
}, semverMatch[1], opts)
}, rawRef, opts)
: remoteRefs
? BB.resolve(
remoteRefs.refs[rawRef] || remoteRefs.refs[remoteRefs.shas[rawRef]]
Expand Down

0 comments on commit 77a676a

Please sign in to comment.