cargo fmt

This commit is contained in:
blinxen committed 2026-06-26 20:27:49 +02:00
1 parent d695ad8f88
commit f9eed8d619
1 file changed
+3 -3
+3 -3
View File
@@ -44,9 +44,9 @@ pub fn get_git_diff(filename: &Path) -> Option<LineChanges> {
let filepath_absolute = filename.canonicalize().ok()?; let filepath_absolute = filename.canonicalize().ok()?;
let repository = gix::discover(filepath_absolute.parent().ok()?).ok()?; let repository = gix::discover(filepath_absolute.parent().ok()?).ok()?;
let repo_path_absolute = repository.workdir()?.canonicalize().ok()?; let repo_path_absolute = repository.workdir()?.canonicalize().ok()?;
let filepath_relative_to_repo = gix::path::to_unix_separators_on_windows( let filepath_relative_to_repo = gix::path::to_unix_separators_on_windows(gix::path::into_bstr(
gix::path::into_bstr(filepath_absolute.strip_prefix(&repo_path_absolute).ok()?) filepath_absolute.strip_prefix(&repo_path_absolute).ok()?,
); ));
let index = repository.index_or_load_from_head_or_empty().ok()?; let index = repository.index_or_load_from_head_or_empty().ok()?;
let index_entry = index.entry_by_path(filepath_relative_to_repo.as_ref())?; let index_entry = index.entry_by_path(filepath_relative_to_repo.as_ref())?;
let mut cache = repository let mut cache = repository