Expand description
Utilities for handling git repositories, mainly around authentication/cloning.
Structs
GitCheckoutis a local checkout of a particular revision. Callingclone_intowith a reference will resolve the reference into a revision, and return ananyhow::Errorif no revision for that reference was found.GitDatabaseis a local clone of a remote repository’s database. MultipleGitCheckoutscan be cloned from thisGitDatabase.GitRemoterepresents a remote repository. It gets cloned into a localGitDatabase.
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 🔒
- 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.