ok/jj
1
0
Fork 0
forked from mirrors/jj

working_copy: propagate errors from failing to read conflict file

This commit is contained in:
Martin von Zweigbergk 2023-07-21 07:42:00 -07:00 committed by Martin von Zweigbergk
parent 99fec7ed06
commit 861788ae09

View file

@ -864,7 +864,10 @@ impl TreeState {
conflict_id: ConflictId,
executable: bool,
) -> Result<TreeValue, SnapshotError> {
let mut file = File::open(disk_path).unwrap();
let mut file = File::open(disk_path).map_err(|err| SnapshotError::IoError {
message: format!("Failed to open file {}", disk_path.display()),
err,
})?;
let mut content = vec![];
file.read_to_end(&mut content).unwrap();
let conflict = self.store.read_conflict(repo_path, &conflict_id)?;