forked from mirrors/jj
working_copy: propagate errors from failing to read conflict file
This commit is contained in:
parent
99fec7ed06
commit
861788ae09
1 changed files with 4 additions and 1 deletions
|
@ -864,7 +864,10 @@ impl TreeState {
|
||||||
conflict_id: ConflictId,
|
conflict_id: ConflictId,
|
||||||
executable: bool,
|
executable: bool,
|
||||||
) -> Result<TreeValue, SnapshotError> {
|
) -> 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![];
|
let mut content = vec![];
|
||||||
file.read_to_end(&mut content).unwrap();
|
file.read_to_end(&mut content).unwrap();
|
||||||
let conflict = self.store.read_conflict(repo_path, &conflict_id)?;
|
let conflict = self.store.read_conflict(repo_path, &conflict_id)?;
|
||||||
|
|
Loading…
Reference in a new issue