Expand description
Utilities for handling git repositories, mainly around authentication/cloning.
Structsยง
- A local checkout of a particular revision from a
GitDatabase
. - A local clone of a remote repositoryโs database. Multiple
GitCheckout
s can be cloned from a singleGitDatabase
. - A remote repository. It gets cloned into a local
GitDatabase
. - A short abbreviated OID.
Enumsยง
- FastPathRev ๐The result of GitHub fast path check. See
github_fast_path
for more.
Constantsยง
- CHECKOUT_READY_LOCK ๐A file indicates that if present,
git reset
has been done and a repo checkout is ready to go. SeeGitCheckout::reset
for why we need this.
Functionsยง
- Constructs an absolute URL for a child submodule URL with its parent base URL.
- Removes temporary files left from previous activity.
- Attempts to fetch the given git
reference
for a Git repository. - fetch_with_cli ๐Attempts to use
git
CLI installed on the system to fetch a repository, when the config valuenet.git-fetch-with-cli
is set. - github_fast_path ๐Attempts GitHubโs special fast path for testing if weโve already got an up-to-date copy of the repository.
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 ๐Initializes a Git repository at
path
. - is_github ๐Whether a
url
is one from GitHub. - is_short_hash_of ๐Whether
rev
is a shorter hash ofoid
. - Whether a
rev
looks like a commit hash (ASCII hex digits). - maybe_gc_repo ๐Attempts to
git gc
a repository. - reinitialize ๐Reinitializes a given Git repository. This is useful when a Git repository seems corrupted and we want to start over.
- reset ๐
git reset --hard
to the givenobj
for therepo
. - Resolves
GitReference
to an object ID with objects therepo
currently has. - rev_to_oid ๐Turns a full commit hash revision into an oid.
- serialize_str ๐
- with_authentication ๐Prepare the authentication callbacks for cloning a git repository.
- Prepares the callbacks for fetching a git repository.