Skip to content

Commit f3cf972

Browse files
committed
relitivize blame
1 parent a0a9804 commit f3cf972

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/commands/blame.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use crate::error::GitAiError;
55
use crate::git::refs::get_reference_as_authorship_log_v3;
66
use crate::git::repository::Repository;
77
use crate::git::repository::exec_git;
8+
#[cfg(windows)]
9+
use crate::utils::normalize_to_posix;
810
use chrono::{DateTime, FixedOffset, TimeZone, Utc};
911
use std::collections::HashMap;
1012
use std::fs;
@@ -194,6 +196,12 @@ impl Repository {
194196
file_path.to_string()
195197
};
196198

199+
#[cfg(windows)]
200+
let relative_file_path = normalize_to_posix(&relative_file_path);
201+
202+
#[cfg(not(windows))]
203+
let relative_file_path = relative_file_path;
204+
197205
let abs_file_path = repo_root.join(&relative_file_path);
198206

199207
// Validate that the file exists

0 commit comments

Comments
 (0)