Skip to main content

Module command_runner

Module command_runner 

Source
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§

CommandEnvironment
How a child process should inherit or receive environment variables.
CommandExit
Exit status of a completed child.
CommandHandleError
Returned when an operation requires a live OS child but the handle is synthetic.
CommandOutput
Output from RunningCommand::wait_with_output.
CommandSpec
Typed description of a subprocess to spawn.
RecordingRunner
Records CommandSpec invocations and returns configurable exit statuses.
RunningCommand
Live child process with optional piped stdio.
SystemCommandRunner
Runs commands with the real OS process API.

Enums§

CommandStdin
Stdin source for the child.
CommandStdio
Stdio disposition for a child stream.
RecordedResponse
Scripted responses for RecordingRunner.
ShellInvocation
Shell invocation mode (Git sh -c hooks and filters).

Traits§

CommandRunner
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 script and collect stdout (common helper for textconv/trailers).
system_command_runner
Default shared system runner.