Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(git): git deps were getting _resolved without shasums
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 31, 2017
1 parent dc0d368 commit 96f0675
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/fetchers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Fetcher.impl(fetchGit, {
opts = optCheck(opts)
let streamError
const stream = new PassThrough().on('error', e => { streamError = e })
const cacheName = manifest._resolved || spec.saveSpec || spec.fetchSpec
const cacheName = manifest._uniqueResolved || manifest._resolved
const cacheStream = (
opts.cache &&
cacache.get.stream(
Expand All @@ -69,11 +69,9 @@ Fetcher.impl(fetchGit, {
manifest._repo, manifest._ref, manifest._rawRef, tmp, opts
).then(HEAD => {
if (streamError) { throw streamError }
if (!manifest._resolved) {
manifest._resolved = spec.saveSpec.replace(/#.*/, `#${HEAD}`)
manifest._uniqueResolved = manifest._resolved
}
return packDir(manifest, cacheName, tmp, stream, opts)
manifest._resolved = spec.saveSpec.replace(/#.*/, `#${HEAD}`)
manifest._uniqueResolved = manifest._resolved
return packDir(manifest, manifest._uniqueResolved, tmp, stream, opts)
})
}).catch(err => stream.emit('error', err))
}
Expand Down Expand Up @@ -125,8 +123,8 @@ function plainManifest (repo, spec, opts) {
return {
_repo: repo,
_rawRef: rawRef,
_resolved: rawRef.match(/^[a-f0-9]$/) && resolved,
_uniqueResolved: rawRef.match(/^[a-f0-9]$/) && resolved
_resolved: rawRef.match(/^[a-f0-9]{40}$/) && resolved,
_uniqueResolved: rawRef.match(/^[a-f0-9]{40}$/) && resolved
}
}
})
Expand Down

0 comments on commit 96f0675

Please sign in to comment.