Stubbing unix-dependent values on Windows (#8036)

Release Notes:

- N/A
This commit is contained in:
白山風露 2024-02-20 10:41:35 +09:00 committed by GitHub
parent 0037f0b2fd
commit 77974a4367
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 5 deletions

View file

@ -11,6 +11,9 @@ use fsevent::StreamFlags;
#[cfg(not(target_os = "macos"))]
use notify::{Config, EventKind, Watcher};
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
use futures::{future::BoxFuture, Stream, StreamExt};
use git2::Repository as LibGitRepository;
use parking_lot::Mutex;
@ -21,7 +24,6 @@ use std::io::Write;
use std::sync::Arc;
use std::{
io,
os::unix::fs::MetadataExt,
path::{Component, Path, PathBuf},
pin::Pin,
time::{Duration, SystemTime},
@ -239,8 +241,16 @@ impl Fs for RealFs {
} else {
symlink_metadata
};
#[cfg(unix)]
let inode = metadata.ino();
// todo!(windows)
#[cfg(windows)]
let inode = 0;
Ok(Some(Metadata {
inode: metadata.ino(),
inode,
mtime: metadata.modified().unwrap(),
is_symlink,
is_dir: metadata.file_type().is_dir(),