pub enum HunkSelectError {
Show 13 variants
UnknownId {
id: String,
},
StaleId {
id: HunkId,
path: Option<String>,
current_ids: Vec<HunkId>,
},
WrongSide {
id: HunkId,
actual_side: DiffSide,
requested_side: DiffSide,
},
UnselectableSide {
side: DiffSide,
},
Binary {
path: String,
},
Apply(ApplyError),
RangeOutOfBounds {
path: String,
start: usize,
end: usize,
max_line: usize,
},
RangeSelectsNothing {
path: String,
},
Gitlink {
path: String,
},
InvalidMode {
path: String,
mode: String,
},
MissingPath,
Repository(Box<Error>),
PatchBuild,
}Expand description
Failure while resolving or staging hunk ids.
Variants§
UnknownId
Id string is not 12 lowercase hex characters.
StaleId
Id is well-formed but no longer present on the requested side.
Fields
WrongSide
Id belongs to the other index/worktree side (for example staged vs unstaged).
Fields
UnselectableSide
Hunks can only be selected on DiffSide::Unstaged or DiffSide::Staged.
Binary
Binary paths cannot be partially staged by hunk id.
Apply(ApplyError)
Index apply failed after hunk resolution.
RangeOutOfBounds
Line range lies outside the file’s new-side line count.
Fields
RangeSelectsNothing
Range does not select any additions or deletions.
Gitlink
Submodule (gitlink) entries cannot be restored hunk by hunk.
InvalidMode
A diff reported a file mode that is not an octal Git mode.
MissingPath
A patch passed in for restoring names neither an old nor a new path.
Repository(Box<Error>)
Repository or diff engine failure (not a hunk-id selection error).
Match on the boxed crate::error::Error to branch on the underlying failure, for
example crate::error::Error::RequiresWorkTree when the repository is bare.
PatchBuild
Selected hunks could not be turned into an apply patch.
Trait Implementations§
Source§impl Debug for HunkSelectError
impl Debug for HunkSelectError
Source§impl Display for HunkSelectError
impl Display for HunkSelectError
Source§impl Error for HunkSelectError
impl Error for HunkSelectError
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()