Expand description
Pure-Rust git operations for stackless, backed by grit-lib.
Sole owner of the grit-lib dependency. Two consumers build on the
primitives here:
stackless-localsource materialization (ARCHITECTURE.md §8): one bare cache repo per source URL (fetch_bare), shared across instances; per instance a thin checkout whose objects are borrowed from the cache viaobjects/info/alternates(checkout_detached). grit-lib’sOdbhonors that alternates file, so instances duplicate no objects.stackless-vercel/stackless-rendercloud prepare: a self-contained shallow clone + checkout (clone_checkout).
Transport is dispatched by URL scheme: https/http over grit-lib’s
ureq-backed smart-HTTP client, and file:///local paths over the
local object-transfer path. Credential prompting is non-interactive by
design (grit-lib’s helper provider never blocks on a TTY): a missing
credential fails fast so callers can map it to a typed fault.
Structs§
- Credentials
- Resolved git authentication: an optional
GITHUB_TOKENoverride for GitHub HTTPS repos, falling back to the operator’s git credential helpers.
Enums§
Functions§
- checkout_
detached - Build a thin instance checkout at
dest: a non-bare repo whose objects are borrowed fromcache_git_dirviaobjects/info/alternates,HEADdetached atcommit, and the commit’s tree written into the working tree. - clone_
checkout - fetch_
bare - Ensure
git_diris an initialized bare repo, then fetchrefspecsfromurlinto it. Covers both the initial clone (a fresh bare repo) and a refresh of an existing one — grit-lib’s fetch copies only objects not already present, so a no-op refresh writes nothing. - resolve_
commit - Resolve
reference(branch, tag, or full/abbrev SHA) to a full commit hex, using objects ingit_dirand any alternates it points at. - snapshot_
worktree - Shallow clone
urlatreferenceand check it out intodest. Self- contained (no shared cache), mirroringgit clone --depth 1 --branch <ref>. Snapshot a dirty working tree into instance-owned space atdest.