working_copy: propagate errors when reading conflicted file

This commit is contained in:
Martin von Zweigbergk 2023-08-11 22:02:20 -07:00 committed by Martin von Zweigbergk
parent 33a93b6d2d
commit 23f54b8151

View file

@ -973,7 +973,11 @@ impl TreeState {
err,
})?;
let mut content = vec![];
file.read_to_end(&mut content).unwrap();
file.read_to_end(&mut content)
.map_err(|err| SnapshotError::IoError {
message: format!("Failed to read file {}", disk_path.display()),
err,
})?;
let new_file_ids = conflicts::update_from_content(
&old_file_ids,
self.store.as_ref(),