Skip to content

Commit

Permalink
fix(git): hash was not being replaced/appended correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jun 1, 2017
1 parent d8bbd5b commit 6fcbed5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 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._uniqueResolved || manifest._resolved
const cacheName = manifest._uniqueResolved || manifest._resolved || ''
const cacheStream = (
opts.cache &&
cacache.get.stream(
Expand All @@ -69,7 +69,7 @@ Fetcher.impl(fetchGit, {
manifest._repo, manifest._ref, manifest._rawRef, tmp, opts
).then(HEAD => {
if (streamError) { throw streamError }
manifest._resolved = spec.saveSpec.replace(/#.*/, `#${HEAD}`)
manifest._resolved = spec.saveSpec.replace(/(:?#.*)?$/, `#${HEAD}`)
manifest._uniqueResolved = manifest._resolved
return packDir(manifest, manifest._uniqueResolved, tmp, stream, opts)
})
Expand Down

0 comments on commit 6fcbed5

Please sign in to comment.