Skip to content

Commit dffed09

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/core/src/backend/ignore.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,9 @@ fn map_entry(
528528
let path = entry.into_path();
529529
let open = Some(OpenFile(path.clone()));
530530
let path = path.strip_prefix(base_path).unwrap();
531-
let path = UnixPath::new(path.as_os_str().as_encoded_bytes()).to_path_buf();
531+
let path = WindowsPath::new(path.as_os_str().as_encoded_bytes())
532+
.to_path_buf()
533+
.with_encoding::<UnixEncoding>();
532534
Ok(ReadSourceEntry { path, node, open })
533535
}
534536

@@ -630,6 +632,8 @@ fn map_entry(
630632
with_atime: bool,
631633
ignore_devid: bool,
632634
) -> IgnoreResult<ReadSourceEntry<OpenFile>> {
635+
use typed_path::{UnixEncoding, WindowsPath};
636+
633637
let name = entry.file_name().as_encoded_bytes();
634638
let m = entry
635639
.metadata()

0 commit comments

Comments
 (0)