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.
&stris 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: Onlygit addis judged, and only when Git accepts its options. The text quotes the caller’s own tokens, so-vAis named as written.