mirror of
https://github.com/sharkdp/bat
synced 2026-07-05 14:13:17 +00:00
cargo fmt
This commit is contained in:
+3
-3
@@ -44,9 +44,9 @@ pub fn get_git_diff(filename: &Path) -> Option<LineChanges> {
|
||||
let filepath_absolute = filename.canonicalize().ok()?;
|
||||
let repository = gix::discover(filepath_absolute.parent().ok()?).ok()?;
|
||||
let repo_path_absolute = repository.workdir()?.canonicalize().ok()?;
|
||||
let filepath_relative_to_repo = gix::path::to_unix_separators_on_windows(
|
||||
gix::path::into_bstr(filepath_absolute.strip_prefix(&repo_path_absolute).ok()?)
|
||||
);
|
||||
let filepath_relative_to_repo = gix::path::to_unix_separators_on_windows(gix::path::into_bstr(
|
||||
filepath_absolute.strip_prefix(&repo_path_absolute).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 mut cache = repository
|
||||
|
||||
Reference in New Issue
Block a user