Skip to content

Commit 29e45d1

Browse files
committed
adapt to changes in gix-index
1 parent 983e668 commit 29e45d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gix-status/src/index_as_worktree/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<'index> State<'_, 'index> {
349349
Err(err) => return Err(Error::Io(err)),
350350
};
351351
self.symlink_metadata_calls.fetch_add(1, Ordering::Relaxed);
352-
let metadata = match worktree_path.symlink_metadata() {
352+
let metadata = match gix_index::fs::Metadata::from_path_no_follow(worktree_path) {
353353
Ok(metadata) if metadata.is_dir() => {
354354
// index entries are normally only for files/symlinks
355355
// if a file turned into a directory it was removed

gix-worktree-state/src/checkout/entry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ where
160160
file.close()?;
161161
}
162162

163-
entry.stat = Stat::from_fs(&std::fs::symlink_metadata(dest)?)?;
163+
entry.stat = Stat::from_fs(&gix_index::fs::Metadata::from_path_no_follow(dest)?)?;
164164
obj.data.len()
165165
}
166166
gix_index::entry::Mode::DIR => {
@@ -287,7 +287,7 @@ where
287287
}
288288
// NOTE: we don't call `file.sync_all()` here knowing that some filesystems don't handle this well.
289289
// revisit this once there is a bug to fix.
290-
entry.stat = Stat::from_fs(&file.metadata()?)?;
290+
entry.stat = Stat::from_fs(&gix_index::fs::Metadata::from_file(&file)?)?;
291291
file.close()?;
292292
Ok(())
293293
}

0 commit comments

Comments
 (0)