Skip to main content

Module action

Module action 

Source
Expand description

The decision one invocation ends in: become Git, or print and exit. What: The decision one wrapper invocation ends in. Why: Forwarding replaces the process and cannot run inside a unit test; returning the decision as data lets every path be checked directly.

In TS you’d write (pseudocode):

// type Action = { kind: 'forward'; ... } | { kind: 'exit'; code: number; stdout: string; stderr: string };

Structs§

PushForward
What: What a plain push that may be integrated needs to run and, when it fails on a divergence, to merge. Why: The run keeps the caller’s streams like the settled one does, so the integration step starts from Git’s status and the same arguments, environment and (inside a linked worktree) settlement as an unstacked push would have had.

Enums§

Action
What: What the executable must do for one invocation. Vec<OsString> is an owned argument list; Vec<(OsString, OsString)> is an owned list of name/value pairs; String is owned UTF-8 text. Why: The executable performs exactly one of these: become Git, run Git and then add text, or print and exit.

Constants§

ENGINE_FAILURE_EXIT_CODE
What: Exit code for a usage, configuration or wrapper failure that kept Git from running. i32 is a signed 32-bit integer, the type of process exit codes. Why: The wrapper’s contract reserves 2 for these, distinct from 1 for policy findings.

Functions§

failure
What: Build the stop action for a wrapper failure described in prose. &str borrows the message; the action owns its formatted copy. Why: These failures (no real Git, a forwarding loop, an unreadable repository) print one prefixed, line-terminated diagnostic on standard error and exit 2.
with_leading_notice
What: Put a notice in front of the standard-error text an action already carries. Option<&str> is the notice or nothing (string | undefined). Why: The notice that the real Git came from the unit’s record and not from PATH is owed to the person before anything else the invocation says, whichever way the invocation ends; every variant carries its standard-error text, so the one prefix covers them all and no start of Git has to know about it.