Expand description
Injectable subprocess execution for hooks, filters, credentials, and helpers.
All std::process::Command usage in non-test library code lives in
SystemCommandRunner. Embedders and tests use RecordingRunner or custom
CommandRunner implementations.
Library guide: command_runner
use grit_lib::repo::{InitOptions, Repository};
let dir = tempfile::tempdir()?;
let _repo = Repository::init(dir.path(), &InitOptions::default())?;Modules§
- hooks
- Git hook execution helpers.
Structs§
- Command
Environment - How a child process should inherit or receive environment variables.
- Command
Exit - Exit status of a completed child.
- Command
Handle Error - Returned when an operation requires a live OS child but the handle is synthetic.
- Command
Output - Output from
RunningCommand::wait_with_output. - Command
Spec - Typed description of a subprocess to spawn.
- Recording
Runner - Records
CommandSpecinvocations and returns configurable exit statuses. - Running
Command - Live child process with optional piped stdio.
- System
Command Runner - Runs commands with the real OS process API.
Enums§
- Command
Stdin - Stdin source for the child.
- Command
Stdio - Stdio disposition for a child stream.
- Recorded
Response - Scripted responses for
RecordingRunner. - Shell
Invocation - Shell invocation mode (Git
sh -chooks and filters).
Traits§
- Command
Runner - Spawns subprocesses; the only production implementation uses
std::process::Command.
Functions§
- run_
program - Run a program with argv and collect stdout.
- run_
sh_ dash_ c - Run
sh -c scriptand collect stdout (common helper for textconv/trailers). - system_
command_ runner - Default shared system runner.