pub enum CloneError {
DestNotEmpty(String),
RemoteRefNotFound(String),
InvalidCloneDepth,
Library(Error),
Remote(RemoteError),
}Expand description
Errors during clone.
Variants§
DestNotEmpty(String)
Destination exists and is not empty.
Grit does not create or modify the destination in this case; callers must not run
cleanup_failed_clone on the path.
RemoteRefNotFound(String)
Named branch or tag from CloneOptions::branch was not advertised by the remote.
InvalidCloneDepth
CloneOptions::depth was zero (git clone --depth 0 is invalid).
Library(Error)
Underlying library failure.
Remote(RemoteError)
Remote resolution or transport failure.
Implementations§
Source§impl CloneError
impl CloneError
Sourcepub fn should_cleanup_failed_clone(&self) -> bool
pub fn should_cleanup_failed_clone(&self) -> bool
Whether cleanup_failed_clone may run after this failure.
Returns false when the destination must be left unchanged: CloneError::DestNotEmpty
and pre-initialization failures such as RemoteError::InvalidRemoteName.
Sourcepub fn is_remote_ref_not_found(&self) -> bool
pub fn is_remote_ref_not_found(&self) -> bool
Whether the failure is a missing -b / --branch ref (destination may be removed).
Sourcepub fn is_remote_unreadable(&self) -> bool
pub fn is_remote_unreadable(&self) -> bool
Whether the source could not be read at all (Error::RemoteUnreadable), as opposed to
an empty remote with no branches or a local failure.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the clone was cancelled (Error::Cancelled).
When this returns true, Self::should_cleanup_failed_clone is also true.
Trait Implementations§
Source§impl Debug for CloneError
impl Debug for CloneError
Source§impl Display for CloneError
impl Display for CloneError
Source§impl Error for CloneError
impl Error for CloneError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()