Expand description
Utilities for handling git repositories, mainly around authentication/cloning.
Structs§
- Checkout
Guard πSeeGitCheckout::reset
for rationale on this type. - 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§
- Fast
Path πRev The result of GitHub fast path check. Seegithub_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 usegit
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. 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 aurl
is one from GitHub. - is_
short_ πhash_ of Whetherrev
is a shorter hash ofoid
. - Whether a
rev
looks like a commit hash (ASCII hex digits). - maybe_
gc_ πrepo Attempts togit 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.