pub fn restores_index_only(region: &[OsString]) -> boolExpand description
What:
Whether a git restore region touches the index only.
Why:
--staged alone unstages and leaves the files,
so the guidance differs from a restore of file content;
--worktree beside it brings the files back in.
--st and --w are the shortest unambiguous prefixes.
A token that
is the value of --source,
-s or --conflict is that value and never a flag (restore --source -W --staged names
a revision -W and restores the index only).
In TS you’d write (pseudocode):
function restoresIndexOnly(region: string[]): boolean;