Skip to main content

Module git

Module git 

Source
Expand description

The closed git subprocess layer. Every git invocation in the binary goes through here: argv-style, never a shell, never --force (save the one worktree remove --force of a unit worktree). Publish failures are classified: CAS/push rejection → a typed LostRace; anything else → an exit-1 class error with git’s stderr tail.

Structs§

Git
A git handle rooted at one directory (the primary checkout or a worktree).

Enums§

GitError

Functions§

parse_porcelain_z
status --porcelain=v1 -z output as (XY, path) pairs. A rename or copy entry is followed by one more NUL-terminated field, its original path, which is skipped: the entry counts once, under its new path.
resolve_mainline
Mainline resolution, in order of precedence: --mainline flag > repo config mainline > origin/HEAD > the primary checkout’s current branch > main/master > error.
use_push
use_push arbitration: origin exists AND fetch origin <mainline> succeeds.