pub struct RefName(/* private fields */);Expand description
A validated git reference name (branch/tag/remote-tracking ref). Every
GitApi operation that names a branch, tag, or ref to create, delete,
rename, or look up by exact name takes a RefName (directly or inside its
options struct), so a name from untrusted input (UIs, bots, agents) is
validated once, at construction, and the type — not an internal guard — is
the argv-injection barrier from then on. For a general commit-ish or range
(checkout, reset_hard, log, diff ranges, …) use the more permissive
RevSpec instead.
Rules follow the load-bearing core of git check-ref-format: non-empty,
no leading - or ., no .., no control characters or space, none of
~ ^ : ? * [ \, no trailing / or .lock. A rejected name is an
vcs_cli_support::is_invalid_input failure.