mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-07 05:16:33 +00:00
working copy: make some reset errors less specific
Same reasoning as the previous commits.
This commit is contained in:
parent
645be615b4
commit
0e09d53ce6
1 changed files with 13 additions and 3 deletions
|
@ -395,8 +395,12 @@ pub enum ResetError {
|
|||
},
|
||||
#[error("Internal error: {0}")]
|
||||
InternalBackendError(#[from] BackendError),
|
||||
#[error(transparent)]
|
||||
TreeStateError(#[from] TreeStateError),
|
||||
#[error("{message}: {err:?}")]
|
||||
Other {
|
||||
message: String,
|
||||
#[source]
|
||||
err: Box<dyn std::error::Error + Send + Sync>,
|
||||
},
|
||||
}
|
||||
|
||||
struct DirectoryToVisit {
|
||||
|
@ -1635,7 +1639,13 @@ impl LockedLocalWorkingCopy<'_> {
|
|||
}
|
||||
|
||||
pub fn reset(&mut self, new_tree: &MergedTree) -> Result<(), ResetError> {
|
||||
self.wc.tree_state_mut()?.reset(new_tree)?;
|
||||
self.wc
|
||||
.tree_state_mut()
|
||||
.map_err(|err| ResetError::Other {
|
||||
message: "Failed to read the working copy state".to_string(),
|
||||
err: err.into(),
|
||||
})?
|
||||
.reset(new_tree)?;
|
||||
self.tree_state_dirty = true;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue