Skip to main content

decide_commit_only

Function decide_commit_only 

Source
pub fn decide_commit_only(
    arguments: &[OsString],
    wrapper_flags: &[&[u8]],
) -> Result<CommitOnlyDecision, OptionError>
Expand description

What: Decide from arguments alone, or name the repository fact needed. Result<A, B> is “either success A or failure B”. Why: The order mirrors the TypeScript rule: escape hatch, opt-out, -a, pathspec source, explicit only, modes Git owns, then the dirty-index guard. Gotcha: Err means Git 2.56.0 itself refuses the commit options; the caller forwards such a command unchanged so Git prints its own error.

In TS you’d write (pseudocode):

async function commitOnly(args: readonly string[]): Promise<readonly string[]>; // throws