Expand description
Utilities for handling git repositories, mainly around authentication/cloning.
Structs
GitCheckout
is a local checkout of a particular revision. Callingclone_into
with a reference will resolve the reference into a revision, and return ananyhow::Error
if no revision for that reference was found.GitDatabase
is a local clone of a remote repository’s database. MultipleGitCheckouts
can be cloned from thisGitDatabase
.GitRemote
represents a remote repository. It gets cloned into a localGitDatabase
.
Enums
Functions
- Removes temporary files left from previous activity.
- Note that
history
is a complex computed value to determine whether it’s acceptable to perform shallow clones at all. It’s needed to allow the caller to determine the correct position of the destination repository or move it into place should its position change. - 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.
gitoxide
uses shallow locks to assure consistency when fetching to and to avoid races, and to write files atomically. Cargo has its own lock files and doesn’t need that mechanism for race protection, so a stray lock means a signal interrupted a previous shallow fetch and doesn’t mean a race is happening.- 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.