Skip to content

Commit

Permalink
correctly convert windows into unix path
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome committed Jan 13, 2025
1 parent 85cd116 commit 16eab70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/core/src/backend/ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ fn map_entry(
with_atime: bool,
_ignore_devid: bool,
) -> IgnoreResult<ReadSourceEntry<OpenFile>> {
use typed_path::{UnixEncoding, WindowsPath};

let name = entry.file_name().as_encoded_bytes();
let m = entry
.metadata()
Expand Down Expand Up @@ -528,7 +530,9 @@ fn map_entry(
let path = entry.into_path();
let open = Some(OpenFile(path.clone()));
let path = path.strip_prefix(base_path).unwrap();
let path = UnixPath::new(path.as_os_str().as_encoded_bytes()).to_path_buf();
let path = WindowsPath::new(path.as_os_str().as_encoded_bytes())
.to_path_buf()
.with_encoding::<UnixEncoding>();
Ok(ReadSourceEntry { path, node, open })
}

Expand Down

0 comments on commit 16eab70

Please sign in to comment.