Expand description
Utilities for handling git repositories, mainly around authentication/cloning.
Structs§
- Checkout
Guard 🔒 - See
GitCheckout::reset
for rationale on this type. - GitCheckout
- A local checkout of a particular revision from a
GitDatabase
. - GitDatabase
- A local clone of a remote repository’s database. Multiple
GitCheckout
s can be cloned from a singleGitDatabase
. - GitRemote
- A remote repository. It gets cloned into a local
GitDatabase
. - GitShortID
- A short abbreviated OID.
Enums§
- Fast
Path 🔒Rev - 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§
- absolute_
submodule_ 🔒url - Constructs an absolute URL for a child submodule URL with its parent base URL.
- clean_
repo_ 🔒temp_ files - Removes temporary files left from previous activity.
- fetch
- 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. - fetch_
with_ 🔒gitoxide - fetch_
with_ 🔒libgit2 - github_
fast_ 🔒path - Attempts GitHub’s special fast path for testing if we’ve already got an up-to-date copy of the repository.
- has_
shallow_ 🔒lock_ file 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
. - looks_
like_ 🔒commit_ hash - 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
.- resolve_
ref - 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.
- with_
fetch_ options - Prepares the callbacks for fetching a git repository.