Skip to content

Commit 97985bf

Browse files
author
Stephan Dilly
committed
do not run blame on a binary file (earlier out)
1 parent e7b703b commit 97985bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

asyncgit/src/sync/blame.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ pub fn blame_file(
5858
};
5959

6060
let spec = format!("{}:{}", commit_id.to_string(), file_path);
61-
let blame = repo.blame_file(Path::new(file_path), None)?;
61+
6262
let object = repo.revparse_single(&spec)?;
6363
let blob = repo.find_blob(object.id())?;
6464

6565
if blob.is_binary() {
6666
return Err(Error::NoBlameOnBinaryFile);
6767
}
6868

69+
let blame = repo.blame_file(Path::new(file_path), None)?;
70+
6971
let reader = BufReader::new(blob.content());
7072

7173
let lines: Vec<(Option<BlameHunk>, String)> = reader

0 commit comments

Comments
 (0)