Skip to main content

clone_or_fetch

Function clone_or_fetch 

Source
pub fn clone_or_fetch(url: &str, dest: &Path) -> Result<()>
Expand description

Clone url into dest, or fetch all refs if the repo already exists.

Browse URLs (GitHub, GitLab, Bitbucket web pages) are automatically converted to their corresponding git clone URLs first. Remote sources are SSRF-gated and get per-host credentials from the in-app registry (see [cred_injection]). Local/offline sources (a git bundle, a file:// mirror, or a local path) are only permitted when SLOC_GIT_ALLOW_LOCAL is set and resolve under SLOC_GIT_LOCAL_ROOT.

ยงErrors

Returns an error if the source is rejected, the clone directory cannot be created, or the underlying git clone / git fetch command fails.