Skip to main content

Module git

Module git 

Source
Expand description

Git-operations slice for rtb-forge v0.2 (the v0.5 framework milestone).

§Foundation

This module ships the Repo type — a thin, async wrapper over gix that downstream tools compose richer git-based behaviour on top of. Per project memory: Repo is a foundation, not a curated facade. v0.5 lays the vocabulary; v0.5.x and later add capability without breaking the public surface.

§Backend

gix is the primary backend; gix::ThreadSafeRepository is the storage type so Repo: Send + Sync and can be cloned freely across tokio::spawn boundaries. Every public method wraps a blocking gix call in tokio::task::spawn_blocking (per spec §3.1 + A1 resolution).

Write paths (commit, checkout, fetch, push, and an authenticated clone) shell out to the git binary, which must be on PATH at runtime. libgit2 is not used.

§Auth

Auth-requiring methods (clone, fetch, push) take a &CredentialRef (already declared by the host tool’s typed config) and resolve through rtb_credentials::Resolver. See crate::git::auth for the glue and the v0.5 scope spec §3.3 for the rationale (A2 resolution — no parallel TokenSource trait).

§Error model

Backend errors are wrapped, not leaked (A8). See RepoError for the variants; each operation stringifies its backend error into the variant’s cause field.

Structs§

Blame
Blame result for a file at a revspec — one entry per line.
BlameLine
Per-line blame data for a single line of a file.
CheckoutOptions
Options for Repo::checkout.
CloneOptions
Options for Repo::clone.
CommitInfo
Per-commit data surfaced by CommitWalk.
CommitWalk
Async stream over the commits matched by a Repo::walk call.
Diff
Structured diff between two tree-ish references.
FetchOptions
Options for Repo::fetch.
FileChange
A single file-level change in a Diff.
InitOptions
Options for Repo::init.
PushOptions
Options for Repo::push.
Repo
A repository handle. Cheap to clone — every field is either Arc-wrapped (the gix handle) or a small owned value.
RepoStatus
Working-tree status snapshot.

Enums§

ChangeKind
What happened to a file between two tree-ish references.
RepoError
Errors surfaced by every method on crate::git::Repo.