#[non_exhaustive]pub enum PathReject {
Show 17 variants
Empty,
TooLong,
ComponentTooLong,
Nul,
Control,
NonAscii,
ForbiddenCharacter,
Absolute,
HomeReference,
DotDot,
DotComponent,
TrailingDot,
LockSuffix,
LeadingDash,
EmptyComponent,
TooFewComponents,
TooManyComponents,
}Expand description
Why a repository path was refused.
Carried in Error::InvalidPath so tests can assert which rule fired
rather than merely that something failed. A sandbox that rejects the right
input for the wrong reason is one refactor away from accepting it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Nothing, or only quotes.
TooLong
Longer than MAX_PATH_BYTES.
ComponentTooLong
A component longer than MAX_COMPONENT_BYTES.
Nul
A NUL byte: the classic truncation trick against a C consumer.
Control
A control character or a space.
NonAscii
A byte outside ASCII. See the module docs: this is deliberate.
ForbiddenCharacter
A character that is legal in ASCII but not in a gunnar name.
Absolute
Still absolute after the one permitted leading / was taken off.
HomeReference
A ~ home-directory reference. The server has no home directories.
DotDot
A .. anywhere.
DotComponent
A component that is exactly ., or starts with one.
TrailingDot
A component ending in ..
LockSuffix
A component ending in .lock.
git’s own lock-file suffix. Merged in from the gunnar-ssh sandbox this
one replaced: a repository or namespace called x.lock would
collide with a lock file on the fs backend, and a ref named after it
would collide in gix-ref.
LeadingDash
A component starting with -, which reads as a command-line flag.
EmptyComponent
An empty component (a leading, trailing or doubled /).
TooFewComponents
Fewer than two components: no namespace. Multi-tenancy is not optional (multi-tenancy).
TooManyComponents
More than MAX_COMPONENTS components.