Skip to main content

Module wrapped_command

Module wrapped_command 

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

WrappedOutcome
What: How the lifecycle of one wrapped command ended. An enum is 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. &StrippedInvocation borrows the invocation without its wrapper controls; &mut ShippedChecks<F> lends the shipped policies and their facts provider F for 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.