From 23f54b8151749ff30cb45f0f07dd6bf901452557 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 11 Aug 2023 22:02:20 -0700 Subject: [PATCH] working_copy: propagate errors when reading conflicted file --- lib/src/working_copy.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index d0b13b5b9..414a95e31 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -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(),