Module cargo::sources::git::utils

source ·
Expand description

Utilities for handling git repositories, mainly around authentication/cloning.

Structs

GitCheckout is a local checkout of a particular revision. Calling clone_into with a reference will resolve the reference into a revision, and return an anyhow::Error if no revision for that reference was found.
GitDatabase is a local clone of a remote repository’s database. Multiple GitCheckouts can be cloned from this GitDatabase.
GitRemote represents a remote repository. It gets cloned into a local GitDatabase.

Enums

Functions

Removes temporary files left from previous activity.
Updating the index is done pretty regularly so we want it to be as fast as possible. For registries hosted on GitHub (like the crates.io index) there’s a fast path available to use 1 to tell us that there’s no updates to be made.
init 🔒
is_github 🔒
Cargo has a bunch of long-lived git repositories in its global cache and some, like the index, are updated very frequently. Right now each update creates a new “pack file” inside the git database, and over time this can cause bad performance and bad current behavior in libgit2.
reset 🔒
Prepare the authentication callbacks for cloning a git repository.