Skip to main content

StashError

Enum StashError 

Source
#[non_exhaustive]
pub enum StashError {
Show 17 variants CorruptStash { oid: ObjectId, reason: CorruptStashReason, }, NotFound { n: usize, }, CommitNotOnStack { oid: ObjectId, }, NoInitialCommit, BareRepository, IndexConflict, MissingHead, WouldOverwriteLocalChanges { paths: String, }, IndexWrite { source: PathIoError, }, SymlinkNotUtf8, CouldNotRestoreUntracked { path: String, }, HunkSelection(HunkSelectError), Branch(BranchError), Apply(ApplyError), InvalidSignature(SignatureError), PushValidation(StashPushValidationError), WorktreeUpdateFailed { path: String, message: String, },
}
Expand description

Stash list, push, apply, pop, drop, and branch failures.

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.
§

CorruptStash

Stash W commit has an invalid parent layout.

Fields

§oid: ObjectId

Stash W commit object id.

§reason: CorruptStashReason

What was wrong with the commit graph.

§

NotFound

stash@{{n}} is out of range for the current stash reflog.

Fields

§n: usize

Stash reflog index (stash@{{n}}).

§

CommitNotOnStack

A stash commit id was given to pop but is not on refs/stash.

Fields

§oid: ObjectId

Stash W commit object id.

§

NoInitialCommit

Push or create requires at least one commit on the current branch.

§

BareRepository

Apply, push, or pop requires a working tree.

§

IndexConflict

Apply with restore_index could not merge the current index with the stashed index parent.

§

MissingHead

HEAD does not resolve while applying a stash entry.

§

WouldOverwriteLocalChanges

Applying a stash would overwrite locally modified worktree content.

Fields

§paths: String

Space-separated paths (same layout as Git’s message list).

§

IndexWrite

The index could not be written after a successful stash apply.

Fields

§source: PathIoError

Git-directory path I/O failure.

§

SymlinkNotUtf8

A symlink blob in a stash commit is not valid UTF-8.

§

CouldNotRestoreUntracked

Applying a stash with an untracked-files parent would replace an existing worktree path.

Fields

§path: String

Worktree path that already exists and blocks untracked restore.

§

HunkSelection(HunkSelectError)

Partial push hunk selection failed.

§

Branch(BranchError)

Branch create during stash branch failed validation or state checks.

§

Apply(ApplyError)

Patch application while building the W tree failed.

§

InvalidSignature(SignatureError)

Identity on push options could not be written into a commit.

§

PushValidation(StashPushValidationError)

§

WorktreeUpdateFailed

Worktree path update failed while finishing a stash push reset.

Fields

§path: String

Repository-relative path.

§message: String

Apply or checkout detail.

Implementations§

Source§

impl StashError

Source

pub fn kind_name(&self) -> &'static str

Stable snake_case slug for this failure (the kind of its serialized form).

Trait Implementations§

Source§

impl Debug for StashError

Source§

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

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

impl Display for StashError

Source§

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

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

impl Error for StashError

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<ApplyError> for StashError

Source§

fn from(source: ApplyError) -> Self

Converts to this type from the input type.
Source§

impl From<BranchError> for StashError

Source§

fn from(source: BranchError) -> Self

Converts to this type from the input type.
Source§

impl From<HunkSelectError> for StashError

Source§

fn from(source: HunkSelectError) -> Self

Converts to this type from the input type.
Source§

impl From<SignatureError> for StashError

Source§

fn from(source: SignatureError) -> Self

Converts to this type from the input type.
Source§

impl From<StashError> for Error

Source§

fn from(err: StashError) -> Self

Converts to this type from the input type.
Source§

impl From<StashPushValidationError> for StashError

Source§

fn from(source: StashPushValidationError) -> 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.