diff --git a/src/main.rs b/src/main.rs index b00a093..29b45ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,8 +24,9 @@ fn count_lines(repo: &Repository, commit: &Commit) -> anyhow::Result { if matches!(entry.mode, EntryMode::Blob | EntryMode::BlobExecutable) { let object = repo.find_object(entry.oid)?; let data = object.detach().data; - let text = String::from_utf8(data)?; - lines += text.lines().count(); + if let Ok(text) = String::from_utf8(data) { + lines += text.lines().count(); + } } } Ok(lines)