Skip to content

Commit

Permalink
adapt to changes in gix-index
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 11, 2023
1 parent 3c8421f commit 8134767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gix-status/src/index_as_worktree/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl<'index> State<'_, 'index> {
Err(err) => return Err(Error::Io(err)),
};
self.symlink_metadata_calls.fetch_add(1, Ordering::Relaxed);
let metadata = match worktree_path.symlink_metadata() {
let metadata = match gix_index::fs::Metadata::from_path_no_follow(worktree_path) {
Ok(metadata) if metadata.is_dir() => {
// index entries are normally only for files/symlinks
// if a file turned into a directory it was removed
Expand Down
4 changes: 2 additions & 2 deletions gix-worktree-state/src/checkout/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ where
file.close()?;
}

entry.stat = Stat::from_fs(&std::fs::symlink_metadata(dest)?)?;
entry.stat = Stat::from_fs(&gix_index::fs::Metadata::from_path_no_follow(dest)?)?;
obj.data.len()
}
gix_index::entry::Mode::DIR => {
Expand Down Expand Up @@ -285,7 +285,7 @@ pub(crate) fn finalize_entry(
}
// NOTE: we don't call `file.sync_all()` here knowing that some filesystems don't handle this well.
// revisit this once there is a bug to fix.
entry.stat = Stat::from_fs(&file.metadata()?)?;
entry.stat = Stat::from_fs(&gix_index::fs::Metadata::from_file(&file)?)?;
file.close()?;
Ok(())
}

0 comments on commit 8134767

Please sign in to comment.