Skip to main content

Module rule_add_explicit

Module rule_add_explicit 

Source
Expand description

Pure decision of the add-explicit policy. What: Pure decision of the add-explicit policy: git add names the paths it stages. Why: git add ., git add -A and git add -u sweep up every changed path, including ones the caller never looked at, so one commit stops describing one change. The policy rejects those forms. This file decides from the arguments alone; it reads no file and starts no process.

In TS you’d write (pseudocode):

// decideAddExplicit(['add', '.']) => 'cli-git: git add rejects bulk-staging patterns (.) ...'

Constants§

BULK_ADD_CODE
What: The finding code of an add-explicit rejection. &str is borrowed text baked into the program. Why: Callers identify the finding by this stable code.

Functions§

decide_add_explicit
What: Decide from the argument list: the rejection text, or nothing to let the command through. &[OsString] borrows the arguments, already free of wrapper controls; Option<String> is “owned text or nothing”. Why: Only git add is judged, and only when Git accepts its options. The text quotes the caller’s own tokens, so -vA is named as written.