Expand description
The lifecycle of one wrapped Git command, from refusals to forwarding. What: Decide what one wrapped Git command does once real Git is known: forward it, possibly rewritten, or stop with policy events or a refusal. Why: This is the whole lifecycle of a forwarded command in one place and in the installed wrapper’s order: unported work is refused, configuration is loaded only for commands that need it, the policy pass runs, and a real push is stopped until its own lifecycle exists. A read-only command never reads configuration and asks Git at most where it runs.
In TS you’d write (pseudocode):
// const outcome = await runWrappedCommand(stripped, environment, checks);Enums§
- Wrapped
Outcome - What:
How the lifecycle of one wrapped command ended.
An
enumis a closed set of named alternatives; each carries the values its ending needs.#[derive(...)]asks the compiler to generate copying, debug printing and==. Why: The caller either becomes Git with these arguments or exits with this code; both may first print event lines on standard error.
Functions§
- run_
wrapped_ command - What:
Run the lifecycle of one wrapped command.
&StrippedInvocationborrows the invocation without its wrapper controls;&mut ShippedChecks<F>lends the shipped policies and their facts providerFfor writing. Why: A command Git does not run as a subcommand is forwarded as it is. A read-only command skips configuration and every refusal check, and uses the default settings. Every other command is prepared first. Then one pre-forward pass runs, and a real push must also clear the manual-push gate.