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

git: disable shallow clones for non-hosted gits #101

Open
zkat opened this issue Jun 9, 2017 · 1 comment
Open

git: disable shallow clones for non-hosted gits #101

zkat opened this issue Jun 9, 2017 · 1 comment

Comments

@zkat
Copy link
Owner

zkat commented Jun 9, 2017

Ref: npm/npm#16898 (comment)

Gotta try relevant hosts and make sure all the hosted ones are able to do shallow clones like these. :\

@raphinesse
Copy link

raphinesse commented Jun 23, 2018

Isn't this already implemented by the following lines?

pacote/lib/fetchers/git.js

Lines 165 to 174 in ccc6e90

// 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) {
const ref = resolvedRef ? resolvedRef.ref : rawRef
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)
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants