Skip to content

Commit 2b02dc6

Browse files
committed
correctly convert windows into unix path
1 parent 85cd116 commit 2b02dc6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/core/src/backend/ignore.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ fn map_entry(
630630
with_atime: bool,
631631
ignore_devid: bool,
632632
) -> IgnoreResult<ReadSourceEntry<OpenFile>> {
633+
use typed_path::{UnixEncoding, WindowsPath};
634+
633635
let name = entry.file_name().as_encoded_bytes();
634636
let m = entry
635637
.metadata()
@@ -727,7 +729,9 @@ fn map_entry(
727729
let path = entry.into_path();
728730
let open = Some(OpenFile(path.clone()));
729731
let path = path.strip_prefix(base_path).unwrap();
730-
let path = UnixPath::new(path.as_os_str().as_encoded_bytes()).to_path_buf();
732+
let path = WindowsPath::new(path.as_os_str().as_encoded_bytes())
733+
.to_path_buf()
734+
.with_encoding::<UnixEncoding>();
731735
Ok(ReadSourceEntry { path, node, open })
732736
}
733737

0 commit comments

Comments
 (0)