mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 18:41:56 +03:00
Use try_from_bytes for windows build (#7500)
Reduce windows build error. Release Notes: - N/A
This commit is contained in:
parent
c7b022144f
commit
42a5081aff
@ -5,14 +5,12 @@ use parking_lot::Mutex;
|
|||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
ffi::OsStr,
|
|
||||||
os::unix::prelude::OsStrExt,
|
|
||||||
path::{Component, Path, PathBuf},
|
path::{Component, Path, PathBuf},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
time::SystemTime,
|
time::SystemTime,
|
||||||
};
|
};
|
||||||
use sum_tree::{MapSeekTarget, TreeMap};
|
use sum_tree::{MapSeekTarget, TreeMap};
|
||||||
use util::ResultExt;
|
use util::{paths::PathExt, ResultExt};
|
||||||
|
|
||||||
pub use git2::Repository as LibGitRepository;
|
pub use git2::Repository as LibGitRepository;
|
||||||
|
|
||||||
@ -119,7 +117,7 @@ impl GitRepository for LibGitRepository {
|
|||||||
|
|
||||||
if let Some(statuses) = self.statuses(Some(&mut options)).log_err() {
|
if let Some(statuses) = self.statuses(Some(&mut options)).log_err() {
|
||||||
for status in statuses.iter() {
|
for status in statuses.iter() {
|
||||||
let path = RepoPath(PathBuf::from(OsStr::from_bytes(status.path_bytes())));
|
let path = RepoPath(PathBuf::try_from_bytes(status.path_bytes()).unwrap());
|
||||||
let status = status.status();
|
let status = status.status();
|
||||||
if !status.contains(git2::Status::IGNORED) {
|
if !status.contains(git2::Status::IGNORED) {
|
||||||
if let Some(status) = read_status(status) {
|
if let Some(status) = read_status(status) {
|
||||||
|
Loading…
Reference in New Issue
Block a user