@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
968 lines • 37.8 kB
TypeScript
import type { FsCondition } from '../../../../errors/types.ts';
export declare const FATAL_EXIT = 128;
/**
* Base for a git fatal: rendered as `fatal: <message>`, exit 128.
*
* Subclasses override `prefix`, `exitCode` and `stream` when git words their case
* differently, so every verb can keep one `instanceof GitError` arm and the
* rendering stays in one place. A null prefix prints the message alone, which is
* what git does when the refusal is a report rather than an error ("nothing to
* commit"), and such a report goes to stdout because that is where the report it
* replaces would have gone.
*
* `report` is the other half of a refusal git splits across both streams: the
* sentence saying it refused goes to stderr, and the per-path diagnosis naming
* what is in the way goes to stdout, which is where the same lines would have
* gone had the command run.
*/
export declare class GitError extends Error {
readonly prefix: string | null;
readonly exitCode: number;
readonly stream: 'stdout' | 'stderr';
readonly report: string;
}
/**
* No `.git` at the start point or above it, up to the mount root.
*
* git quotes a path the user typed (`--git-dir`, `GIT_DIR`) and leaves unquoted
* one it read out of a `.git` file, pinned against git 2.50.1.
*/
export declare class NotARepositoryError extends GitError {
constructor(gitdir?: string | null, quoted?: boolean);
}
/** A `.git` file that is not a `gitdir:` pointer. */
export declare class InvalidGitFileError extends GitError {
constructor(path: string);
}
/**
* A revision that resolves to nothing.
*
* git answers every unresolvable revision with one wording, whether the ref is
* unknown, the short sha matches nothing, or an ancestry step walked off the end
* of history (pinned against git 2.47.3 for `show`, `log` and `rev-parse`
* alike).
*/
export declare class AmbiguousArgumentError extends GitError {
readonly revision: string;
constructor(revision: string);
}
/**
* A negated revision (`^<rev>`) that resolves to nothing.
*
* git words this one differently from a plain unknown revision, and refuses a
* negated range (`^A..B`) the same way (pinned against git 2.50).
*/
export declare class BadRevisionError extends GitError {
constructor(revision: string);
}
/**
* A walk's operand, with no `--` on the line, that names both a revision and a
* file in the working tree, which git refuses to guess between (pinned against
* git 2.47.3).
*/
export declare class RevisionAndFilenameError extends GitError {
constructor(operand: string);
}
/**
* An operand after a walk's first path, with no `--` on the line, that names
* nothing in the working tree (pinned against git 2.47.3).
*/
export declare class NoSuchPathError extends GitError {
constructor(operand: string);
}
/** `diff A...B` between two histories that share no commit. */
export declare class NoMergeBaseError extends GitError {
constructor(revision: string);
}
/** A boolean config variable whose value git cannot read as one. */
export declare class BadConfigValueError extends GitError {
constructor(value: string, key: string);
}
/**
* A date flag whose value could not be read.
*
* git accepts relative wording (`2 weeks ago`) that mirage does not, so an
* unreadable value is refused rather than ignored: silently dropping the flag
* would widen the window instead of narrowing it.
*/
export declare class BadDateError extends GitError {
constructor(flag: string, value: string);
}
/**
* A verb that reads or writes files, run with no work tree to enter.
*
* git refuses a bare repository and a work tree that is not a directory in the
* same words (pinned against git 2.54), so a mistyped
* `--work-tree` is never taken for an empty tree.
*/
export declare class NotAWorkTreeError extends GitError {
constructor();
}
/**
* A work tree holding more files than its mount's `walkLimit`. The scan
* stops there, and a status or an add over part of the tree would read as
* one over all of it, so the verb fails instead.
*/
export declare class WorkTreeLimitError extends GitError {
constructor(limit: number);
}
/**
* A verb that writes the index refused by a read-only mount: git takes the
* index lock before anything else and dies naming it (pinned against git
* 2.47.3).
*/
export declare class IndexLockError extends GitError {
constructor(gitdir: string);
}
/**
* A ref a read-only mount will not let a verb write: git names the ref and the
* lock it could not take (pinned against git 2.47.3).
*/
export declare class RefReadOnlyError extends GitError {
constructor(ref: string, path: string);
}
/** `symbolic-ref`'s ref transaction refused by a read-only mount, an `error` exiting 1. */
export declare class SymbolicRefReadOnlyError extends RefReadOnlyError {
readonly prefix = "error";
readonly exitCode = 1;
}
/** A ref a read-only mount will not let `branch -d` or `tag -d` delete. */
export declare class RefDeleteReadOnlyError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(ref: string, path: string);
}
/** An annotated tag a read-only mount will not let `tag -a` write. */
export declare class TagWriteReadOnlyError extends GitError {
readonly prefix: null;
constructor();
}
/**
* An object `hash-object -w` a read-only mount will not let it write (pinned
* against git 2.47.3); git prints `(null)` for content read from stdin.
*/
export declare class ObjectWriteReadOnlyError extends GitError {
readonly prefix: null;
constructor(name: string);
}
/** `clone` into a directory a read-only mount will not let it make. */
export declare class CloneReadOnlyError extends GitError {
constructor(directory: string);
}
/** `fetch` refused by a read-only mount, at FETCH_HEAD; git exits 255. */
export declare class FetchHeadReadOnlyError extends GitError {
readonly prefix = "error";
readonly exitCode = 255;
constructor(path: string);
}
/**
* `init` refused a directory it makes by a read-only mount: git's `perror` of
* the directory and exit 1, with no prefix.
*/
export declare class InitReadOnlyError extends GitError {
readonly prefix: null;
readonly exitCode = 1;
constructor(path: string);
}
/** `init` could not create the directory its operand names. */
export declare class CannotMkdirError extends GitError {
constructor(path: string, reason?: string);
}
/**
* A re-`init` that cannot take the config's lock, on a read-only mount or held
* by another writer: git's lock error, then the setting it could not make
* (pinned against git 2.47.3).
*/
export declare class ConfigLockError extends GitError {
readonly prefix: null;
constructor(path: string, reason: FsCondition);
}
/** A lock another writer holds, in git's words for every lock file. */
export declare class LockExistsError extends GitError {
constructor(lock: string);
}
/** `checkout -b` given paths as well as a start point (pinned against git 2.50.1). */
export declare class PathsWithBranchError extends GitError {
constructor(branch: string);
}
/**
* `checkout --detach` given more than a commit: whatever is not one is read as
* a path, which a detach does not take (pinned against git 2.50.1).
*/
export declare class DetachPathError extends GitError {
constructor(path: string);
}
/** `<rev>:<path>` whose revision names nothing (pinned against git 2.50.1). */
export declare class InvalidRevisionNameError extends GitError {
constructor(rev: string);
}
/**
* `<rev>:<path>` whose tree has no such path, said differently when the working
* tree has one (pinned against git 2.50.1).
*/
export declare class PathNotInRevisionError extends GitError {
constructor(path: string, rev: string, onDisk: boolean);
}
/** `:<path>` the index does not hold, said differently when the working tree does. */
export declare class PathNotInIndexError extends GitError {
constructor(path: string, onDisk: boolean);
}
/** `:<n>:<path>` the index holds at another stage, with git's hint at that one. */
export declare class PathNotAtStageError extends GitError {
constructor(path: string, stage: number, held: number);
}
/** A branch start point that names nothing (pinned against git 2.50.1). */
export declare class InvalidObjectNameError extends GitError {
constructor(name: string);
}
/**
* A branch start point that names something other than a commit: git names the
* object and its type, then refuses the start point (pinned against git 2.50.1).
*/
export declare class BranchPointError extends GitError {
readonly prefix = "error";
constructor(oid: string, type: string, name: string);
}
/**
* A branch started from a name two refs answer to, which git refuses rather
* than picking one while `core.warnAmbiguousRefs` is on (pinned against git
* 2.47.3).
*/
export declare class AmbiguousObjectNameError extends GitError {
constructor(name: string);
}
/** `rev-parse --abbrev-ref=<mode>` with a mode other than `strict` or `loose`. */
export declare class AbbrevModeError extends GitError {
constructor(mode: string);
}
/**
* `rev-parse --verify` (or `--short`, which implies it) not given exactly one
* revision that names an object.
*/
export declare class SingleRevisionError extends GitError {
constructor();
}
/** `git reset` in a bare repository, refused in its own words. */
export declare class BareResetError extends GitError {
constructor();
}
/**
* A relative `core.worktree` that git cannot enter.
*
* git resolves one by entering it before any verb runs, so every verb fails,
* the read-only ones included (pinned against git 2.54).
*/
export declare class WorkTreeChdirError extends GitError {
constructor(path: string, reason?: FsCondition);
}
/**
* `-C` named a path git could not enter.
*
* Two reasons, both in git's own wording: nothing is there, or something is and
* it is not a directory. The second matters as much as the first, because
* discovery walks upwards from the start point: a file operand that is merely
* tolerated finds the repository above it and quietly runs there instead.
*/
export declare class NoWorkingDirectoryError extends GitError {
constructor(path: string, reason?: FsCondition);
}
/**
* `checkout -b` given a start point that is not a commit.
*
* git blames the start point rather than the branch name, and says so in one
* sentence naming both, which is more use than the generic "ambiguous argument"
* the same lookup failure produces elsewhere.
*/
export declare class BadStartPointError extends GitError {
constructor(start: string, name: string);
}
/**
* `reset` given a revision, which this build does not take.
*
* Real git resets the index to any commit named here. mirage resets it from
* HEAD only, so the operand has nothing to do, and doing nothing quietly is the
* one answer a caller cannot act on: a script reads the zero exit as "the index
* was reset" when it was not. Saying which feature is missing beats reusing
* "unknown revision" for a revision that is perfectly well known.
*/
export declare class RevisionResetError extends GitError {
constructor(revision: string);
}
/**
* A dashed operand, which is a git feature this build does not have.
*
* mirage implements a subset of every verb, so an undeclared flag is rarely a
* typo: it is a real git option (`-p`, `--graph`, `--follow`) arriving at a
* build that lacks it. Left alone it lands on the revision operand and comes
* back as "ambiguous argument", which blames the repository for missing a
* commit rather than mirage for missing a feature, and an agent reading that
* draws the wrong conclusion. git words the same mistake this way for `log`
* and `show`.
*/
export declare class UnrecognizedArgumentError extends GitError {
constructor(argument: string);
}
/**
* `commit -a` given paths as well.
*
* git refuses the pair before reading anything, naming the first path (pinned
* against git 2.50).
*/
export declare class AllWithPathsError extends GitError {
constructor(path: string);
}
/**
* `commit` given paths, which this build does not take.
*
* Real git commits only those paths, from the working tree, and leaves the
* rest of the index staged. mirage commits the whole index, and doing that while
* the caller named a subset would record changes they never asked to commit, so
* the operand is refused instead.
*/
export declare class PartialCommitError extends GitError {
constructor(path: string);
}
/**
* A pattern that does not compile, named as git names it: where it came from
* and what the engine said.
*/
export declare class PatternCompileError extends GitError {
constructor(origin: string, pattern: string, reason: string);
}
/**
* A --pretty/--format value naming no format at all.
*
* git's own wording and exit code for a name it has never heard of.
*/
export declare class BadPrettyError extends GitError {
constructor(value: string);
}
/**
* A --pretty/--format preset git has but this build does not.
*
* `email`, `mboxrd` and `reference` are real git formats; answering
* "invalid" for them would gaslight an agent that spelled a valid one, so the
* refusal says unsupported and names what exists instead.
*/
export declare class UnsupportedPrettyError extends GitError {
constructor(value: string);
}
/** A path operand that resolves outside the working tree. */
export declare class OutsideRepositoryError extends GitError {
constructor(operand: string, root: string);
}
/** A path operand that matches nothing in the working tree. */
export declare class PathspecError extends GitError {
constructor(pathspec: string);
}
/**
* An empty pathspec operand, which git refuses rather than reading as
* everything (pinned against git 2.54).
*/
export declare class EmptyPathspecError extends GitError {
constructor();
}
/**
* Pathspec magic git has but this build does not read.
*
* `:(top)`, `:!`, `:(icase)` and their kin are real git; matching the operand
* as a plain path would select nothing, or the wrong paths, and look like an
* answer, so the refusal says unsupported and names what exists instead.
*/
export declare class UnsupportedPathspecError extends GitError {
constructor(pathspec: string);
}
/**
* Explicitly named paths that an ignore rule covers.
*
* git refuses rather than staging them, because naming an ignored path is far
* more often a mistake than an intention, and exits 1 rather than its usual 128.
* Expanding a directory is not the same act: there the ignored files are
* silently skipped, which is why only operands that name a file reach this.
*/
export declare class IgnoredPathsError extends GitError {
readonly prefix: null;
readonly exitCode = 1;
constructor(paths: readonly string[]);
}
/**
* A path `add` or `commit -a` could not read to stage. git names the open
* that failed and the file it could not index, then gives up on the whole
* update, and words the end by whether the index already held the path.
* Pinned against git 2.47.3. Mirrors Python's UnindexableFileError.
*/
export declare class UnindexableFileError extends GitError {
readonly prefix = "error";
constructor(name: string, reason: string, tracked: boolean);
}
/**
* A working-tree file `diff` could not read to compare. Pinned against git
* 2.47.3. Mirrors Python's UnhashableFileError.
*/
export declare class UnhashableFileError extends GitError {
readonly prefix = "error";
constructor(name: string, reason: string);
}
/**
* `add` with no pathspec at all. Not an error by exit code: git says what it did
* not do and exits 0, because nothing went wrong and nothing happened.
*/
export declare class NothingSpecifiedError extends GitError {
readonly prefix: null;
readonly exitCode = 0;
constructor();
}
/**
* `commit` with no `-m`.
*
* git would open an editor here. A mount has no editor to open and no terminal
* to open it on, and inventing a message would put an unreviewed sentence into
* history, so the flag is required rather than defaulted.
*/
export declare class MissingMessageError extends GitError {
constructor();
}
/** `commit` while paths are still in conflict. */
export declare class UnmergedIndexError extends GitError {
constructor();
}
/** `branch <name>` naming a branch that is already there. */
export declare class BranchExistsError extends GitError {
constructor(name: string);
}
/**
* A branch name git's ref rules refuse.
*
* Refused before the name reaches a ref file, because a ref is written as a path
* below `.git`: `../../config` would land on the repository's own configuration
* rather than on a branch. git closes the refusal with the two hint lines kept
* here, and words it without the full stop its tag twin carries. Pinned against
* git 2.50.1.
*/
export declare class InvalidBranchNameError extends GitError {
constructor(name: string);
}
/** `branch -d` with nothing to delete: git dies, 128 (pinned against git 2.50.1). */
export declare class BranchNameRequiredError extends GitError {
constructor();
}
/** `branch -d` naming the branch HEAD is on. */
export declare class CheckedOutBranchError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(name: string, worktree: string);
}
/**
* `-d` naming a branch whose commits HEAD does not already hold.
*
* The branch name is the only thing pointing at those commits, so deleting it
* leaves them unreachable and there is no reflog here to find them again. git
* refuses for that reason and reserves `-D` for a caller who means it, which is
* why `-d` alone would be the wrong shape to ship: it would be a delete with no
* way to say no.
*
* Only the first of git's two hint lines is kept. The second names the config
* knob that silences the advice, and there is no git config here to set.
*/
export declare class UnmergedBranchError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(name: string);
}
/** A branch name that resolves to nothing. */
export declare class NoBranchError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(name: string);
}
/**
* An operand that is neither a ref nor a path git has heard of.
*
* One sentence, two exit codes, which is git's own split rather than ours:
* `checkout` refuses with 1, and `add -u` treats the same sentence as a fatal
* and exits 128. Measured one verb at a time on git 2.50.1.
*/
export declare class UnknownPathspecError extends GitError {
readonly prefix = "error";
readonly exitCode: number;
constructor(target: string, fatal?: boolean);
}
/**
* A checkout that would throw away work that is not committed.
*
* git refuses and names every file rather than overwriting, which is the one
* safety check that makes checkout usable at all: without it a branch switch
* silently destroys whatever was edited and not staged.
*
* Two kinds of work are at risk and git words them differently: a tracked file
* carrying uncommitted changes, an untracked *directory* the target replaces
* with a file of the same name, and an untracked file the target branch would
* write over. All three are carried here rather than thrown separately because
* when several apply git prints every paragraph and aborts once, in this
* order, pinned against git 2.50.1.
*/
export declare class CheckoutConflictError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(local: readonly string[], untracked: readonly string[], directories?: readonly string[]);
}
/**
* A branch move while the index still records conflict stages.
*
* Every collision check a checkout makes reads stage 0, so a path held only as
* stages 1-3 is invisible to all of them: the move would clear the stages and
* delete the working-tree copy, throwing away a conflict resolution in progress
* with no reflog to recover it from. git refuses first, before it reads either
* tree.
*
* Both streams carry part of it, pinned against git 2.50.1: the per-path
* diagnosis is stdout's, written by the index refresh that found the stages, and
* the sentence saying the command stopped is stderr's. Exit 1, not the 128 a
* fatal takes.
*/
export declare class ResolveIndexError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
readonly report: string;
constructor(paths: readonly string[]);
}
/**
* `restore` naming a path the source cannot put back.
*
* A path with conflict stages has no stage-0 content, so restoring the working
* tree from the index has nothing to write and restoring the index from a tree
* that does not hold the path has nothing to stage. git names each such path and
* does none of the work; a path the source *does* hold restores normally and the
* stages go with it.
*
* One line per path, so several are refused in one answer rather than one per
* run. Pinned against git 2.50.1.
*/
export declare class UnmergedPathError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(paths: readonly string[]);
}
/**
* A refusal parse-options words in full, exit 129.
*
* Already worded, the verb's usage block included where git prints one: after
* an unknown option on stderr, or alone, on stdout when `-h` asked for it and
* on stderr where it stands for the refusal itself (`rev-list --nosuch`,
* `symbolic-ref` with no operand). The usage block `-h` asked for is help, not
* a refusal, and exits 0 (git 2.56).
*/
export declare class UsageError extends GitError {
readonly prefix: null;
readonly exitCode: number;
readonly stream: 'stdout' | 'stderr';
/**
* @param shown what goes to stdout, empty unless `-h` asked
* @param refused what goes to stderr
*/
constructor(shown: string, refused: string);
}
/**
* `remote` given a word where its subcommand would go.
*
* An unsupported subcommand is refused the way git refuses one it does not
* know, with the usage block after it. Pinned against git 2.50.1.
*/
export declare class UnknownSubcommandError extends UsageError {
constructor(word: string, usage: string);
}
/**
* `diff`'s wording for an option it does not know, on a line naming neither a
* revision nor `--cached`.
*
* Same mistake as UnrecognizedArgumentError and a different sentence, because
* git itself words it differently here, follows it with the usage block and
* exits 129 rather than 128. A line that names one gets the usage block alone.
* Pinned against git 2.50.1.
*/
export declare class InvalidOptionError extends UsageError {
constructor(argument: string, usage: string);
}
/**
* `shortlog`'s wording for an option it does not know.
*
* parse-options' sentence with the word quoted whole, dashes and all, because
* shortlog hands what it does not know to the revision parser and words what
* that parser leaves; the usage block follows. Pinned against git 2.50.1.
*/
export declare class ShortlogOptionError extends UsageError {
constructor(argument: string, usage: string);
}
/** `rm` with no pathspec at all. */
export declare class NoPathspecRemoveError extends GitError {
constructor();
}
/** `rm` naming a directory without `-r`. */
export declare class NotRecursiveError extends GitError {
constructor(operand: string);
}
/**
* `rm` naming a path whose removal would lose uncommitted work.
*
* git refuses rather than deleting, and names every path under the reason it
* refused it. Three reasons, printed as three paragraphs in a fixed order when
* more than one applies, pinned against git 2.50.1.
*/
export declare class RemovalRefusedError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(both: readonly string[], staged: readonly string[], local: readonly string[]);
}
/**
* `rm` whose working-tree deletion the mount refused.
*
* git names the path and the strerror. The one reason a mount gives is a
* directory standing where a tracked file was: `unlink` refuses that, and git
* reports it rather than removing the tree.
*
* The `rm` lines ride along on stdout because git prints them for every
* selected path before it deletes anything, so the ones printed before the
* failure are printed whether the line goes through or not.
*/
export declare class RemovePathError extends GitError {
readonly report: string;
constructor(path: string, report?: string, reason?: FsCondition);
}
/**
* A working-tree removal that would take a nested mount with it.
*
* A mount nested inside the repository is served by another VFS entirely,
* so removing the directory it stands in empties that backend rather than the
* repository: the store behind it is gone, and no branch ever recorded a line
* of it. mirage refuses instead, which is the rule `MountRootPolicy` already
* enforces for `rm` and `mv` at the command tier; a git verb reaches the
* dispatcher directly, so it has to ask for itself.
*
* The mount is named only when the session may be told about it. A hidden one
* blocks the removal just the same, because avoiding a boundary and naming it
* are two different questions, and naming a hidden mount is the one thing the
* hide exists to prevent.
*/
export declare class MountInWayError extends GitError {
constructor(path: string, mount?: string | null);
}
/** `mv` refusing one source, in git's `reason, source, destination` shape. */
export declare class MoveRefusedError extends GitError {
constructor(reason: string, source: string, destination: string);
}
/**
* `mv` given both a directory and something inside it.
*
* git refuses the whole line rather than one source, and `-k` does not skip it:
* the two moves would race for the same bytes, and the one that lost would be
* reported as a rename that failed after the other had already changed the
* working tree. The child is named first however the operands were ordered.
* Pinned against git 2.50.1.
*/
export declare class MoveOverlapError extends GitError {
constructor(child: string, parent: string);
}
/** `mv` with several sources and a destination that is not a directory. */
export declare class NotADirectoryDestinationError extends GitError {
constructor(destination: string);
}
/**
* `mv` whose rename the mount refused.
*
* git names the source and the strerror. The one reason a mount gives is a
* destination whose directory does not exist: git does not create it, and
* neither does this.
*/
export declare class RenameFailedError extends GitError {
constructor(source: string, reason?: FsCondition);
}
/** `restore` with no pathspec at all. */
export declare class NoRestorePathsError extends GitError {
constructor();
}
/**
* `restore --source` naming an object that is no tree.
*
* A revision that resolves is reported by the id it resolved to rather than by
* the spelling, which is git's own wording: the complaint is about the object
* found, not about the name.
*/
export declare class UnreadableTreeError extends GitError {
constructor(oid: string);
}
/** `restore --source` naming a tree this repository cannot resolve. */
export declare class UnresolvableSourceError extends GitError {
constructor(source: string);
}
/**
* `switch` naming something that is neither a branch nor a commit.
*
* `switch` words the miss differently from `checkout`, which calls the same
* operand a pathspec: switch never takes a path, so nothing it was given could
* have been one.
*/
export declare class InvalidReferenceError extends GitError {
constructor(name: string);
}
/**
* `switch` given a commit, tag or remote branch without `--detach`.
*
* git refuses rather than detaching, because a detached HEAD is the state an
* agent loses commits in, and `switch` exists to be the verb that never gets
* there by accident.
*/
export declare class BranchExpectedError extends GitError {
constructor(kind: string, name: string);
}
/** `switch` with nothing to switch to. */
export declare class MissingBranchArgumentError extends GitError {
constructor();
}
/** `switch` given more than one operand. */
export declare class OneReferenceError extends GitError {
constructor();
}
/** `switch -c` together with `--detach`. */
export declare class DetachWithCreateError extends GitError {
constructor();
}
/** `tag <name>` naming a tag that is already there. */
export declare class TagExistsError extends GitError {
constructor(name: string);
}
/**
* `tag -d` naming a tag that is not there.
*
* Reported and moved past: git deletes the other names on the line and exits 1
* at the end, so this is rendered per name rather than thrown.
*/
export declare class TagNotFoundError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(name: string);
}
/**
* A listing option on a `tag` line that deletes rather than lists.
*
* `-n` asks for message lines beside each name and `--contains` and its kin
* narrow which names are listed, all of which only a listing does, and git
* makes each *imply* a listing rather than refuse it: `git tag -n1 nosuch` is a
* listing whose pattern matches nothing and exits 0. The implication is what
* cannot happen once `-d` has already said what mode the line is in, so git
* dies there instead, with the tags untouched, naming the first of `-n`,
* `--contains`, `--no-contains`, `--points-at`, `--merged`, `--no-merged` the
* line holds. Refusing it matters more here than the wording does: read as a
* listing flag and dropped, the line went on to delete the refs its operands
* named. Pinned against git 2.50.1.
*/
export declare class ListModeOnlyError extends GitError {
constructor(option?: string);
}
/**
* `tag -d` naming one tag twice.
*
* git stages every deletion on the line as one ref transaction, and a
* transaction holding two updates for the same ref is refused before any of
* them applies, so the whole line is a no-op: the repeated tag survives, and so
* does every other tag the line named. The ref it blames is the first in ref
* order rather than the first typed, since the transaction sorts before it
* looks for the repeat. Reported the way git reports it, as an `error` exiting
* 1 rather than a fatal.
*/
export declare class RefUpdateConflictError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(ref: string);
}
/**
* A ref that cannot be written because another one holds its path.
*
* git reports this as a failure to take the lock rather than as a name that is
* already taken, and names the ref standing in the way. `-f` does not help: the
* obstacle is the path, not the value. Pinned against git 2.50.1.
*/
export declare class RefLockError extends GitError {
constructor(ref: string, held: string);
}
/**
* A HEAD naming a ref whose path leaves the ref tree, which the files backend
* will not lock: `ref: refs/heads/../../config` would otherwise point the new
* commit at the repository's own config. Pinned against git 2.47.3.
*/
export declare class BrokenHeadError extends GitError {
constructor(target: string);
}
/**
* `symbolic-ref` writing a ref whose path another ref holds: the same lock
* failure as RefLockError, which `git symbolic-ref` reports as an `error`
* exiting 1 rather than a fatal (pinned against git 2.47.3).
*/
export declare class SymbolicRefLockError extends RefLockError {
readonly prefix = "error";
readonly exitCode = 1;
}
/** `symbolic-ref` naming a ref that holds an object id, or nothing at all. */
export declare class NotASymbolicRefError extends GitError {
constructor(name: string);
}
/**
* `symbolic-ref` naming a ref git cannot resolve at all: a name its ref rules
* refuse, or a chain of symbolic refs more than five deep.
*/
export declare class NoSuchRefError extends GitError {
constructor(name: string);
}
/** `symbolic-ref -d` naming a ref that is not symbolic; `-q` does not quiet it. */
export declare class NotSymbolicDeleteError extends GitError {
constructor(name: string);
}
/** `symbolic-ref -d HEAD`, which git refuses outright. */
export declare class DeleteHeadError extends GitError {
constructor();
}
/** `symbolic-ref HEAD <ref>` with a target outside `refs/`. */
export declare class HeadOutsideRefsError extends GitError {
constructor();
}
/** `symbolic-ref <name> <ref>` with a target git's ref rules refuse. */
export declare class InvalidSymbolicTargetError extends GitError {
constructor(name: string, target: string);
}
/** `symbolic-ref -m ''`, refused before anything else is read. */
export declare class EmptyUpdateMessageError extends GitError {
constructor();
}
/**
* `symbolic-ref <name> <ref>` with a name git's ref rules refuse, which the
* ref transaction reports as an `error` exiting 1.
*/
export declare class BadRefNameUpdateError extends GitError {
readonly prefix = "error";
readonly exitCode = 1;
constructor(name: string);
}
/** A tag name git's ref rules refuse. */
export declare class InvalidTagNameError extends GitError {
constructor(name: string);
}
/** `tag` given an object it cannot resolve. */
export declare class UnresolvedRefError extends GitError {
constructor(revision: string);
}
/** `tag` given more operands than a name and an object. */
export declare class TooManyArgumentsError extends GitError {
constructor();
}
/**
* `tag -a` with no `-m`.
*
* git would open an editor here, exactly as `commit` would, and the same answer
* applies: a mount has no editor, and inventing a message would put an
* unreviewed one into the repository.
*/
export declare class MissingTagMessageError extends GitError {
constructor();
}
/** Two options git refuses to take together. */
export declare class IncompatibleOptionsError extends GitError {
readonly prefix = "error";
readonly exitCode = 129;
constructor(first: string, second: string);
}
/**
* Two revision-walk options git refuses to take together.
*
* The same sentence as IncompatibleOptionsError, from the revision parser
* rather than parse-options, so git dies with 128 instead of refusing with
* 129: `log --graph --reverse` (pinned against git 2.50.1).
*/
export declare class IncompatibleLogOptionsError extends GitError {
/** @param third a third option, where git names three (`-G`, `-S` and `--find-object`) */
constructor(first: string, second: string, third?: string | null);
}
/** A `--decorate` value that names no decoration style (pinned against git 2.47.3). */
export declare class InvalidDecorateError extends GitError {
constructor(value: string);
}
/**
* `--contains` or `--points-at` given a name that resolves to no object.
*
* Both refuse while the options are parsed, so the line exits 129 and nothing
* is listed; `--points-at` quotes the name and `--contains` does not, which is
* git's own inconsistency (pinned against git 2.50.1).
*/
export declare class MalformedObjectError extends GitError {
readonly prefix = "error";
readonly exitCode = 129;
constructor(name: string, quoted?: boolean);
}
/**
* `--merged` or `--no-merged` given a name that resolves to no object.
*
* The same mistake `MalformedObjectError` reports, and git dies on this one
* instead of refusing the option: exit 128 (pinned against git 2.50.1).
*/
export declare class MalformedMergeFilterError extends GitError {
constructor(name: string);
}
/**
* A commit filter given an object that is no commit, such as a blob.
*
* git names the object and its type, then says which option could not use it:
* `--contains` as `no such commit <name>` and `--merged` as the option itself
* (pinned against git 2.50.1).
*/
export declare class NotACommitError extends GitError {
readonly prefix = "error";
readonly exitCode = 129;
constructor(oid: string, type: string, reason: string);
}
/** A local path that holds no repository, in clone's words. */
export declare class MissingRepositoryError extends GitError {
constructor(url: string);
}
/**
* A `--date` value, or a date atom's argument, git has no style for.
*
* Named as git names it: the whole value, a `-local` suffix and all (pinned
* against git 2.50.1).
*/
export declare class UnknownDateFormatError extends GitError {
constructor(value: string);
}
/** `format` with no `:` before its strftime template. */
export declare class DateFormatColonError extends GitError {
constructor(value: string);
}
/**
* A ref field git has but this build does not render.
*
* `%(describe)`, `%(trailers)`, `%(signature)` and their kin are real git
* fields; calling one unknown would gaslight an agent that spelled it right, so
* the refusal says unsupported instead.
*/
export declare class UnsupportedFieldError extends GitError {
constructor(name: string);
}
/**
* A ref format or option set a verb refuses with its usage.
*
* git prints the line, then the verb's usage, and exits 129; the usage is
* omitted here as it is for every other verb.
*/
export declare class FormatUsageError extends GitError {
readonly prefix = "error";
readonly exitCode = 129;
}
/**
* `branch` and `tag` given a format with a `%(` left open.
*
* `for-each-ref` answers the same format with its usage; these two say it
* twice instead, once as git's `error:` and once as the fatal that follows it
* (pinned against git 2.50.1).
*/
export declare class UnparsableFormatError extends GitError {
readonly prefix = "error";
constructor(rest: string);
}
//# sourceMappingURL=errors.d.ts.map