pub enum GitError {
NotRepository(PathBuf),
EmptyHistory,
UnsafeArgument(String),
Command {
args: Vec<OsString>,
status: Option<i32>,
stderr: String,
},
InvalidOutput(String),
MissingObject(String),
Io(Error),
Utf8(FromUtf8Error),
}Expand description
An error returned by a Git operation.
Variants§
NotRepository(PathBuf)
The path is not inside a Git worktree.
EmptyHistory
The repository has no commit history.
UnsafeArgument(String)
A ref or object name contained an unsafe argument.
Command
Git returned a non-zero status.
Fields
InvalidOutput(String)
Git emitted data that did not match the requested format.
MissingObject(String)
A requested object does not exist.
Io(Error)
An I/O operation failed.
Utf8(FromUtf8Error)
Git output was not valid UTF-8 where text was required.
Trait Implementations§
Source§impl Error for GitError
impl Error for GitError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<FromUtf8Error> for GitError
impl From<FromUtf8Error> for GitError
Source§fn from(error: FromUtf8Error) -> Self
fn from(error: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for GitError
impl !UnwindSafe for GitError
impl Freeze for GitError
impl Send for GitError
impl Sync for GitError
impl Unpin for GitError
impl UnsafeUnpin for GitError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more