Skip to content

Commit

Permalink
fix(git): only resolvedRefs can be shallow-cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Nov 16, 2017
1 parent 62434d6 commit 899720f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fetchers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function withTmp (opts, cb) {
const SHALLOW_HOSTS = new Set(['github', 'gist', 'gitlab', 'bitbucket'])
function cloneRepo (spec, repo, resolvedRef, rawRef, tmp, opts) {
const ref = resolvedRef ? resolvedRef.ref : rawRef
if (spec.hosted && SHALLOW_HOSTS.has(spec.hosted.type)) {
if (resolvedRef && spec.hosted && SHALLOW_HOSTS.has(spec.hosted.type)) {
return git.shallow(repo, ref, tmp, opts)
} else {
return git.clone(repo, ref, tmp, opts)
Expand Down

0 comments on commit 899720f

Please sign in to comment.