Skip to main content

Module gitrun

Module gitrun 

Source
Expand description

Argv-only, hardened git runner for the read features (JSON API, search, releases, archive).

Every invocation goes through solid_pod_rs_git::hardened_git_async (no hooks, no system/global config, no prompts), runs with the bare repo as the working directory, takes arguments as an argv slice (never a shell), has no stdin, no inherited HOME, and a hard stdout cap. Callers validate refs and paths with crate::guard before they get here.

Structs§

GitOut
Result of one git run.

Constants§

GIT_TIMEOUT
Wall-clock budget for one read-side git invocation. Dropping the future on expiry kills the child (kill_on_drop), so a git grep over a huge branch cannot hold a CPU for longer than this.

Functions§

bytes
Run and return raw stdout bytes with the same failure mapping as text.
run
Run git <args> in git_dir, capturing at most cap bytes of stdout.
run_heavy
run for operations that can burn real CPU or memory (search, archive): at most four run at once process-wide, and a request that cannot get a permit within a few seconds is ForgeError::Busy (503).
run_within
run with an explicit wall-clock limit.
text
Run and return stdout as lossy UTF-8; any failure (non-zero exit, truncation) is ForgeError::NotFound when git complains about an unknown object, else ForgeError::Backend.