mirror of
https://github.com/martinvonz/jj.git
synced 2024-10-26 00:19:59 +00:00
git_backend: translate io::Error of read_conflict() to ReadObject error
This is the last place in Git backend where io::Error is magically converted to BackendError::Other.
This commit is contained in:
parent
4e4ca46998
commit
5346bd734f
1 changed files with 6 additions and 1 deletions
|
@ -531,7 +531,12 @@ impl Backend for GitBackend {
|
||||||
&FileId::new(id.to_bytes()),
|
&FileId::new(id.to_bytes()),
|
||||||
)?;
|
)?;
|
||||||
let mut data = String::new();
|
let mut data = String::new();
|
||||||
file.read_to_string(&mut data)?;
|
file.read_to_string(&mut data)
|
||||||
|
.map_err(|err| BackendError::ReadObject {
|
||||||
|
object_type: "conflict".to_owned(),
|
||||||
|
hash: id.hex(),
|
||||||
|
source: err.into(),
|
||||||
|
})?;
|
||||||
let json: serde_json::Value = serde_json::from_str(&data).unwrap();
|
let json: serde_json::Value = serde_json::from_str(&data).unwrap();
|
||||||
Ok(Conflict {
|
Ok(Conflict {
|
||||||
removes: conflict_term_list_from_json(json.get("removes").unwrap()),
|
removes: conflict_term_list_from_json(json.get("removes").unwrap()),
|
||||||
|
|
Loading…
Reference in a new issue