Skip to content

Commit 46f2e14

Browse files
committed
fix windows build
1 parent 448fa58 commit 46f2e14

File tree

1 file changed

+2
-4
lines changed
  • gitoxide-core/src/repository

1 file changed

+2
-4
lines changed

gitoxide-core/src/repository/diff.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ fn resolve_revspec(
127127
Err(gix::revision::spec::parse::Error::FindReference(gix::refs::file::find::existing::Error::NotFound {
128128
name,
129129
})) => {
130-
use std::os::unix::ffi::OsStrExt;
131-
132-
let root: Option<std::path::PathBuf> = repo.workdir().map(std::path::Path::to_path_buf);
133-
let name: BString = BString::new(name.as_os_str().as_bytes().to_vec());
130+
let root = repo.workdir().map(ToOwned::to_owned);
131+
let name = gix::path::os_string_into_bstring(name.into())?;
134132

135133
Ok((ObjectId::null(gix::hash::Kind::Sha1), root, name))
136134
}

0 commit comments

Comments
 (0)