Expand description
Git-based package fetcher.
The Fetcher trait abstracts over different fetch backends (git, luarocks,
http). GitFetcher implements the git backend using libgit2 via the
git2 crate. No subprocess git invocations are used.
§Cache layout
<cache_root>/git/<host>/<path…>/<sha>/For example, https://github.com/ynishi/lshape at SHA abc123 becomes:
<cache_root>/git/github.com/ynishi/lshape/abc123/If the directory already exists the clone is skipped.
§Authentication
GitFetcher uses a RemoteCallbacks-based credential cascade:
- SSH agent (
Cred::ssh_key_from_agent) — tried only when the remote advertisesSSH_KEYinallowed_types. - Credential helper (
Cred::credential_helper) — tried whenUSER_PASS_PLAINTEXTis advertised. Cred::default()— last resort.
The callback tracks attempted credential types to avoid infinite retry loops.
Structs§
- Fetched
Pkg - Result of a successful
Fetcher::fetchcall. - GitFetcher
Fetcherimplementation backed by libgit2.
Traits§
- Fetcher
- Abstraction over package fetch backends.