History

windows: Fix crash when saving files to disk (#11547)

closes #11544, sorry for introduce this issue by pre pr. Release Notes: - N/A

CharlesChen0823 committed 2 years ago

Commit ec3aabe1 parent 4b98c351 file · +1 −1Browse files

Unified · Split

crates/worktree/src/worktree.rs+1−1
@@ -674,7 +674,7 @@ fn start_background_scan_tasks( · 673 unmodified lines
674674 let (scan_states_tx, mut scan_states_rx) = mpsc::unbounded();
675675 let background_scanner = cx.background_executor().spawn({
676676 let abs_path = if cfg!(target_os = "windows") {
677− abs_path.canonicalize().expect("start background scan tasks failed for canonicalize path {abs_path}")
677+ abs_path.canonicalize().unwrap_or_else(|_| abs_path.to_path_buf())
678678 } else {
679679 abs_path.to_path_buf()
680680 };