Skip to content

Commit

Permalink
Enforce path conversion on windows gnu, it doesn't seem to like slash…
Browse files Browse the repository at this point in the history
…es (#298)
  • Loading branch information
Byron committed Apr 6, 2022
1 parent 9a06fe1 commit 410e284
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions git-ref/src/store/file/find.rs
Expand Up @@ -124,11 +124,18 @@ impl file::Store {
};
let relative_path = base.join(inbetween).join(relative_path);

let path_to_open = git_features::path::from_byte_slice_or_panic_on_windows(
git_features::path::convert::to_native_separators(git_features::path::into_bytes_or_panic_on_windows(
&relative_path,
))
.as_ref(),
)
.to_owned();
let contents = match self
.ref_contents(&relative_path)
.ref_contents(&path_to_open)
.map_err(|err| Error::ReadFileContents {
err,
path: relative_path.to_owned(),
path: path_to_open.to_owned(),
})? {
None => {
if is_definitely_absolute {
Expand Down

0 comments on commit 410e284

Please sign in to comment.