Documentation
¶
Overview ¶
Package gitx shells out to the installed git binary (§6: any Git URL syntax git supports is accepted): worktree discovery, remote ref resolution, and a bare-repository cache of scaffold sources (§50). The cache location is $GIT_SCAFFOLD_CACHE, else the global config cache-dir, else $XDG_CACHE_HOME/git-scaffold, else ~/.cache/git-scaffold (§56), keyed by a hash of the source URL. The cache never affects output determinism: it only stores immutable Git objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Git ¶
Git runs an arbitrary git command in dir with optional stdin content and extra environment entries, returning trimmed stdout. It exists for callers (the proposal flow, §39-§45) that drive git plumbing in the target repository rather than the source cache.
func WorktreeRoot ¶
WorktreeRoot resolves the root of the Git worktree containing dir (§49: commands may run from subdirectories).
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a scaffold source repository backed by a bare cache repository.
func Open ¶
Open ensures the bare cache repository for url exists and returns it. No network access occurs.
func (*Source) EnsureCommit ¶
EnsureCommit makes sha available in the cache, fetching only if it is missing (§50: a locally available locked commit needs no network).
func (*Source) ReadTree ¶
ReadTree loads the full tree of a commit into memory as repository-relative `/`-separated paths. Only regular-file blobs are included (§9: symlinks and submodules are never materialized).
func (*Source) ResolveRef ¶
ResolveRef resolves ref against the remote (ls-remote); an empty ref means the remote's HEAD (§6). Refs not advertised remotely (e.g. commit SHAs) fall back to local resolution after a fetch.