do not run blame on a binary file (earlier out)

This commit is contained in:
Stephan Dilly 2021-04-24 14:05:34 +02:00
parent e7b703b922
commit 97985bfe62

View file

@ -58,7 +58,7 @@ pub fn blame_file(
};
let spec = format!("{}:{}", commit_id.to_string(), file_path);
let blame = repo.blame_file(Path::new(file_path), None)?;
let object = repo.revparse_single(&spec)?;
let blob = repo.find_blob(object.id())?;
@ -66,6 +66,8 @@ pub fn blame_file(
return Err(Error::NoBlameOnBinaryFile);
}
let blame = repo.blame_file(Path::new(file_path), None)?;
let reader = BufReader::new(blob.content());
let lines: Vec<(Option<BlameHunk>, String)> = reader