Skip to main content

Crate stackless_git

Crate stackless_git 

Source
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-local source 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 via objects/info/alternates (checkout_detached). grit-lib’s Odb honors that alternates file, so instances duplicate no objects.
  • stackless-vercel / stackless-render cloud 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_TOKEN override for GitHub HTTPS repos, falling back to the operator’s git credential helpers.

Enums§

GitError

Functions§

checkout_detached
Build a thin instance checkout at dest: a non-bare repo whose objects are borrowed from cache_git_dir via objects/info/alternates, HEAD detached at commit, and the commit’s tree written into the working tree.
clone_checkout
fetch_bare
Ensure git_dir is an initialized bare repo, then fetch refspecs from url into 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 in git_dir and any alternates it points at.
snapshot_worktree
Shallow clone url at reference and check it out into dest. Self- contained (no shared cache), mirroring git clone --depth 1 --branch <ref>. Snapshot a dirty working tree into instance-owned space at dest.