Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git: Fix logging FromUtf8Error when diffing (#28276)

Peter Tripp9e504a1ed9fd
diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rs
index 40a46288ee6..da68a532e3e 100644
--- a/crates/git/src/repository.rs
+++ b/crates/git/src/repository.rs
@@ -606,7 +606,7 @@ impl GitRepository for RealGitRepository {
};
let content = repo.find_blob(oid)?.content().to_owned();
- Ok(Some(String::from_utf8(content)?))
+ Ok(String::from_utf8(content).ok())
}
match logic(&repo.lock(), &path) {
@@ -629,8 +629,7 @@ impl GitRepository for RealGitRepository {
return None;
}
let content = repo.find_blob(entry.id()).log_err()?.content().to_owned();
- let content = String::from_utf8(content).log_err()?;
- Some(content)
+ String::from_utf8(content).ok()
})
.boxed()
}