Skip to content

Commit

Permalink
local_working_copy: propagate read_dir error from snapshot()
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Dec 3, 2024
1 parent 8f55680 commit d2c0d92
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/src/local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,11 +1043,13 @@ impl TreeState {

let git_ignore = git_ignore
.chain_with_file(&dir.to_internal_dir_string(), disk_dir.join(".gitignore"))?;
let dir_entries = disk_dir
let dir_entries: Vec<_> = disk_dir
.read_dir()
.unwrap()
.map(|maybe_entry| maybe_entry.unwrap())
.collect_vec();
.and_then(|entries| entries.try_collect())
.map_err(|err| SnapshotError::Other {
message: format!("Failed to read directory {}", disk_dir.display()),
err: err.into(),
})?;
dir_entries.into_par_iter().try_for_each_with(
(
tree_entries_tx.clone(),
Expand Down

0 comments on commit d2c0d92

Please sign in to comment.