From 410e28447fdf11cd563164bdbeb6a5a4a98dcfbc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 6 Apr 2022 20:00:03 +0800 Subject: [PATCH] Enforce path conversion on windows gnu, it doesn't seem to like slashes (#298) --- git-ref/src/store/file/find.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git-ref/src/store/file/find.rs b/git-ref/src/store/file/find.rs index f60c85b8be3..c203565605b 100644 --- a/git-ref/src/store/file/find.rs +++ b/git-ref/src/store/file/find.rs @@ -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 {