pacote
Advanced tools
Comparing version 2.7.33 to 2.7.34
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.7.34"></a> | ||
## [2.7.34](https://github.com/zkat/pacote/compare/v2.7.33...v2.7.34) (2017-06-09) | ||
### Bug Fixes | ||
* **git:** whitelist specific shallow-cloneable hosts ([b210cc8](https://github.com/zkat/pacote/commit/b210cc8)) | ||
<a name="2.7.33"></a> | ||
@@ -7,0 +17,0 @@ ## [2.7.33](https://github.com/zkat/pacote/compare/v2.7.32...v2.7.33) (2017-06-08) |
@@ -68,3 +68,3 @@ 'use strict' | ||
return cloneRepo( | ||
manifest._repo, manifest._ref, manifest._rawRef, tmp, opts | ||
spec, manifest._repo, manifest._ref, manifest._rawRef, tmp, opts | ||
).then(HEAD => { | ||
@@ -162,4 +162,6 @@ if (streamError) { throw streamError } | ||
function cloneRepo (repo, resolvedRef, rawRef, tmp, opts) { | ||
if (resolvedRef) { | ||
// Only certain whitelisted hosted gits support shadow cloning | ||
const SHALLOW_HOSTS = new Set(['github', 'gist', 'gitlab', 'bitbucket']) | ||
function cloneRepo (spec, repo, resolvedRef, rawRef, tmp, opts) { | ||
if (resolvedRef && spec.hosted && SHALLOW_HOSTS.has(spec.hosted.type)) { | ||
return git.shallow(repo, resolvedRef.ref, tmp, opts) | ||
@@ -166,0 +168,0 @@ } else { |
{ | ||
"name": "pacote", | ||
"version": "2.7.33", | ||
"version": "2.7.34", | ||
"description": "JavaScript package downloader", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
82823
1556