pub async fn clone_to_temp(
temp_dir: &Path,
url: &str,
branch: &str,
credential: Option<&CredentialKind>,
follow_redirects: bool,
mirror: bool,
) -> Result<PathBuf, HttpsCloneError>Expand description
Clone url into a new directory under temp_dir and answer it; git
creates whatever part of temp_dir is missing.
With no credential the url goes to git as given, so git decides which
transports it takes. A mirror also gets an .info.json naming branch
and url; when that cannot be written the clone is removed, since the
caller never learns where it was.