Skip to main content

CheckoutError

Enum CheckoutError 

Source
pub enum CheckoutError {
Show 24 variants NotOffered { url: String, endpoint: String, }, Server { url: String, status: u16, message: String, }, InvalidUrl(String), InvalidPath { path: String, reason: &'static str, }, MissingPath { path: String, base: String, }, Mismatch { expected: String, got: String, }, DestinationNotEmpty(PathBuf), InvalidBranchName(String), DamagedRecord { id: String, path: PathBuf, detail: String, }, RefKeptMoving { refname: String, }, WorkBranchTaken { name: String, }, SnapshotMoved { expected: String, got: String, }, BranchMoved { name: String, expected: String, got: String, }, UnrelatedBranch { name: String, }, StillSwitched { branch: String, failed: Box<CheckoutError>, }, OperationInProgress(InProgressOperation), Remote(Box<RemoteError>), Pull(Box<PullError>), Protocol { url: String, detail: String, }, Download(Box<ResumableError>), PromisedBlobs { oid: ObjectId, count: usize, }, PromisedBlobsNotFetched { oid: ObjectId, count: usize, source: Box<Error>, }, Library(Box<Error>), Io(Error),
}
Expand description

Why a snapshot checkout failed.

Variants§

§

NotOffered

The server has no snapshot-checkout endpoint for this repository.

Fields

§url: String

The URL the user gave.

§endpoint: String

The endpoint that was missing.

§

Server

The server refused a request.

Fields

§url: String

The request URL.

§status: u16

The response status.

§message: String

The server’s explanation.

§

InvalidUrl(String)

The URL cannot name a repository.

§

InvalidPath

A path is not a plain path inside the repository.

Fields

§path: String

The path as given.

§reason: &'static str

What is wrong with it.

§

MissingPath

A path is not in the tree being checked out.

Fields

§path: String

The path.

§base: String

The commit it was looked up in.

§

Mismatch

The downloaded snapshot is not the one the server described.

Fields

§expected: String

The snapshot commit the server described.

§got: String

What the download held.

§

DestinationNotEmpty(PathBuf)

The destination already has files.

§

InvalidBranchName(String)

A name is not a valid branch name.

§

DamagedRecord

A checkout’s stored record could not be read.

Fields

§id: String

The checkout’s id.

§path: PathBuf

The record’s file.

§detail: String

What was wrong with it.

§

RefKeptMoving

A ref kept moving while the server tried to set it.

Fields

§refname: String

The ref.

§

WorkBranchTaken

Every work-branch name the server reserved is a branch in the checkout already.

Fields

§name: String

The last name the server reserved.

§

SnapshotMoved

The snapshot fetched is not the one the server described: the checkout was refreshed again (from another worktree, say) meanwhile.

Fields

§expected: String

The snapshot the server described.

§got: String

What the fetch brought into the checkout’s upstream ref.

§

BranchMoved

The projection of a server branch fetched is not the one the server described: the branch was shown to the checkout again meanwhile.

Fields

§name: String

The branch.

§expected: String

The projection the server described.

§got: String

What the fetch brought.

§

UnrelatedBranch

A local branch shares no commit with the server’s branch of its name, as the checkout sees it, and builds on none of its snapshots.

Fields

§name: String

The branch.

§

StillSwitched

A branch that HEAD was switched to for its rebase couldn’t be rebased, and HEAD couldn’t be switched back: it is still on the branch.

Fields

§branch: String

The branch HEAD is on now.

§failed: Box<CheckoutError>

Why the rebase failed.

§

OperationInProgress(InProgressOperation)

The checkout is in the middle of an operation (a stopped rebase, a merge) that has to be finished or aborted first.

§

Remote(Box<RemoteError>)

A fetch from or push to the server failed.

§

Pull(Box<PullError>)

Bringing the current branch onto the new snapshot failed.

§

Protocol

The server’s answer could not be parsed.

Fields

§url: String

The request URL.

§detail: String

What was wrong.

§

Download(Box<ResumableError>)

The download failed.

§

PromisedBlobs

The snapshot needs blobs the repository keeps on a promisor remote (a large-object promisor), and lazy fetch is off, so they cannot be brought in. As for upload-pack, lazy fetch is turned on with uploadpack.lazyFetch or GIT_NO_LAZY_FETCH=0 on the server (see fetch_promised_blobs).

Fields

§oid: ObjectId

The first missing blob.

§count: usize

How many blobs the snapshot lacks.

§

PromisedBlobsNotFetched

The snapshot’s blobs kept on a promisor remote were fetched, but the fetch failed or did not bring them all.

Fields

§oid: ObjectId

The first blob still missing.

§count: usize

How many blobs were missing before the fetch.

§source: Box<Error>

Why the fetch failed.

§

Library(Box<Error>)

A repository operation failed.

§

Io(Error)

A file operation failed.

Trait Implementations§

Source§

impl Debug for CheckoutError

Source§

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

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

impl Display for CheckoutError

Source§

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

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

impl Error for CheckoutError

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<Error> for CheckoutError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for CheckoutError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<PullError> for CheckoutError

Source§

fn from(e: PullError) -> Self

Converts to this type from the input type.
Source§

impl From<RemoteError> for CheckoutError

Source§

fn from(e: RemoteError) -> Self

Converts to this type from the input type.
Source§

impl From<ResumableError> for CheckoutError

Source§

fn from(e: ResumableError) -> 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.