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.

Fix parsing of author name in git show output (#29704)

Cole Miller38ede4bae333
diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rs
index fc293d8a4f1..14fade10741 100644
--- a/crates/git/src/repository.rs
+++ b/crates/git/src/repository.rs
@@ -411,13 +411,13 @@ impl GitRepository for RealGitRepository {
"--no-optional-locks",
"show",
"--no-patch",
- "--format=%H%x00%B%x00%at%x00%ae%x00%an",
+ "--format=%H%x00%B%x00%at%x00%ae%x00%an%x00",
&commit,
])
.output()?;
let output = std::str::from_utf8(&output.stdout)?;
let fields = output.split('\0').collect::<Vec<_>>();
- if fields.len() != 5 {
+ if fields.len() != 6 {
bail!("unexpected git-show output for {commit:?}: {output:?}")
}
let sha = fields[0].to_string().into();