Skip to main content

RevParseError

Enum RevParseError 

Source
#[non_exhaustive]
pub enum RevParseError {
Show 29 variants NoUpstream { branch: String, }, UpstreamNotTracked { merge: String, }, NoPushRemote, PushRefspecMissing { remote: String, branch: String, }, PushDefaultNothing, NoUpstreamForPush { branch: String, }, PushDefaultSimpleMismatch, NoPushTrackingRef { branch: String, }, HeadNotBranch, NoSuchBranch { branch: String, }, AmbiguousRefname { spec: String, }, AutoMergeRead { detail: String, }, InvalidObjectName { name: String, }, RevisionOutOfRange { spec: String, }, OutsideRepository { path: String, work_tree: String, }, AmbiguousArgument { spec: String, }, AmbiguousShortObject { spec: String, }, ReflogEmpty { ref_display: String, }, ReflogInsufficientEntries { ref_display: String, available: usize, }, PathOnDiskNotInRevision { path: String, revision: String, }, PathPrefixExists { candidate: String, path: String, alternate_spec: Option<String>, }, PathNotInRevision { path: String, revision: String, }, PathMissingFromWorktreeAndIndex { path: String, }, PathWrongIndexStage { path: String, stage: u8, alternate_spec: Option<String>, }, PathIndexPrefixMismatch { candidate: String, path: String, alternate_spec: Option<String>, }, PathOnDiskNotInIndex { path: String, }, PathNotInIndex { path: String, }, InternalDescribeRegex, AmbiguousChangeId { prefix: String, candidates: Vec<AmbiguousChangeIdHint>, },
}
Expand description

Failure modes when resolving revision specs, upstream/push refs, paths, and reflogs.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NoUpstream

branch.<name>.merge / remote tracking is not configured.

Fields

§branch: String

Short branch name shown to the user.

§

UpstreamNotTracked

Upstream is configured but the remote-tracking ref is missing.

Fields

§merge: String

Value from branch.*.merge (may include refs/heads/).

§

NoPushRemote

No remote is configured for @{push} resolution.

§

PushRefspecMissing

Remote has push refspecs but none map this branch.

Fields

§remote: String

Remote name from config.

§branch: String

Short branch name.

§

PushDefaultNothing

push.default = nothing and no overriding push refspec applies.

§

NoUpstreamForPush

push.default = upstream but no upstream tracking ref exists.

Fields

§branch: String

Short branch name.

§

PushDefaultSimpleMismatch

push.default = simple and upstream differs from the branch’s push ref.

§

NoPushTrackingRef

Default push mode could not find a tracking ref for the branch.

Fields

§branch: String

Short branch name.

§

HeadNotBranch

HEAD is not on a local branch (detached or unborn).

§

NoSuchBranch

Named branch does not exist under refs/heads/.

Fields

§branch: String

Branch name from the spec.

§

AmbiguousRefname

Short ref name matches more than one ref under DWIM rules.

Fields

§spec: String

User ref spec.

§

AutoMergeRead

Could not read .git/AUTO_MERGE.

Fields

§detail: String

Underlying I/O or parse detail.

§

InvalidObjectName

Spec fragment is not a valid object name after other resolution failed.

Fields

§name: String

The unresolved token.

§

RevisionOutOfRange

Parent/ancestor navigation (~, ^, …) ran past the first root commit.

Fields

§spec: String

Full user revision spec that could not be resolved.

§

OutsideRepository

Path in rev:path lies outside the work tree.

Fields

§path: String

Path from the revision spec.

§work_tree: String

Canonical work-tree path for the message.

§

AmbiguousArgument

Revision string matches neither an object, ref, nor index path.

Fields

§spec: String

Full user spec.

§

AmbiguousShortObject

A short hex prefix matches more than one object.

Fields

§spec: String

Abbreviated object id from the user spec.

§

ReflogEmpty

Reflog selector used but the reflog has no entries.

Fields

§ref_display: String

Human-readable ref label.

§

ReflogInsufficientEntries

Reflog index is out of range.

Fields

§ref_display: String

Human-readable ref label.

§available: usize

Number of entries available.

§

PathOnDiskNotInRevision

Tree path exists at HEAD but not at the requested revision.

Fields

§path: String

Path from the revision spec.

§revision: String

Revision label that lacks the path.

§

PathPrefixExists

Tree path missing; a related path exists under the current prefix.

Fields

§candidate: String

Related path that exists where the requested path does not.

§path: String

Repository-relative or filesystem path related to the failure.

§alternate_spec: Option<String>

Optional alternate rev:path spelling (no Git-style hint prefix).

§

PathNotInRevision

Path is absent from the named tree.

Fields

§path: String

Path that is missing from the tree.

§revision: String

Revision label for the tree that was searched.

§

PathMissingFromWorktreeAndIndex

Index path lookup failed with no work-tree match.

Fields

§path: String

Path that is missing from both the index and work tree.

§

PathWrongIndexStage

Index path exists at another stage.

Fields

§path: String

Repository-relative or filesystem path related to the failure.

§stage: u8

Index stage number (0–3) that was expected.

§alternate_spec: Option<String>

Optional :stage:path spelling to try.

§

PathIndexPrefixMismatch

Index path mismatch under a path prefix.

Fields

§candidate: String

Related path that exists where the requested path does not.

§path: String

Repository-relative or filesystem path related to the failure.

§alternate_spec: Option<String>

Optional alternate rev:path spelling to try.

§

PathOnDiskNotInIndex

File exists in the work tree but is not staged.

Fields

§path: String

Work-tree path that is not staged in the index.

§

PathNotInIndex

Path is not present in the index at all.

Fields

§path: String

Path that is absent from the index.

§

InternalDescribeRegex

Internal describe helper failed to compile its regex.

§

AmbiguousChangeId

A change-id prefix matches more than one commit.

Fields

§prefix: String

User-supplied change-id or prefix.

§candidates: Vec<AmbiguousChangeIdHint>

Matching commits in stable order (oid, then change id).

Trait Implementations§

Source§

impl Debug for RevParseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RevParseError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RevParseError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<RevParseError> for Error

Source§

fn from(source: RevParseError) -> Self

Converts to this type from the input type.
Source§

impl From<RevParseError> for ResolveError

Source§

fn from(value: RevParseError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.