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
namecannot be a short branch name: the rules ofinvalidRefNameReason, andHEADis refused as well — a branch is never namedHEAD, which names the checked-out branch itself. -
checkRemoteLocation(
String location, {required List< String> schemes}) → void -
Refuses
locationunless it is a remote location the engine accepts. -
checkTagName(
String name) → void -
Raises GitInvalidRefNameException when
namecannot be a short tag name: the rules ofinvalidRefNameReasonalone. -
checkWritableRefName(
String ref) → void -
Raises GitInvalidRefNameException when
refcannot be the name of a reference the write operations ofGitRefsandGitRefTransactionaccept: arefs/...name, the rules ofinvalidRefNameReasonapplying to it, or one reference ofspecialRefNames. Any other one-level name is refused. -
readsAsOption(
String token) → bool -
Whether git, launched without a shell, would read
tokenas one of its own options because it starts with the-marker. -
redactGitArguments(
List< String> arguments) → String -
argumentsjoined by spaces for display, with the value of every HTTP extra-header configuration argument replaced by***. -
redactUrlUserinfo(
String text) → String -
textwith the userinfo of every URL it contains replaced by***. -
refuseOptionLikeRevision(
String expression) → void -
Raises GitUnknownRevisionException when
expressionnames no revision because git would read it as an option: it starts with the-marker. -
relativePathError(
String path, {bool windows = false}) → String? -
Why
pathis not a relative path spelled with/, or null when it is one.