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 };

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, 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.