backend library

Rules shared by the engines maintained with the package.

Import this library to apply the common remote-location, reference-name and diagnostic rules to a backend.

Constants

maxDiagnosticChainLength → const int
Maximum number of failures a diagnostic follows through their causes.

Functions

checkBranchName(String name) → void
Raises GitInvalidRefNameException when name cannot be a short branch name: the rules of invalidRefNameReason, and HEAD is refused as well — a branch is never named HEAD, which names the checked-out branch itself.
checkRemoteLocation(String location, {required List<String> schemes}) → void
Refuses location unless it is a remote location the engine accepts.
checkTagName(String name) → void
Raises GitInvalidRefNameException when name cannot be a short tag name: the rules of invalidRefNameReason alone.
checkWritableRefName(String ref) → void
Raises GitInvalidRefNameException when ref cannot be the name of a reference the write operations of GitRefs and GitRefTransaction accept: a refs/... name, the rules of invalidRefNameReason applying to it, or one reference of specialRefNames. Any other one-level name is refused.
readsAsOption(String token) → bool
Whether git, launched without a shell, would read token as one of its own options because it starts with the - marker.
redactGitArguments(List<String> arguments) → String
arguments joined by spaces for display, with the value of every HTTP extra-header configuration argument replaced by ***.
redactUrlUserinfo(String text) → String
text with the userinfo of every URL it contains replaced by ***.
refuseOptionLikeRevision(String expression) → void
Raises GitUnknownRevisionException when expression names no revision because git would read it as an option: it starts with the - marker.
relativePathError(String path, {bool windows = false}) → String?
Why path is not a relative path spelled with /, or null when it is one.