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.

Prefer names over github logins when filling co-authors (#24693)

Kirill Bulatov636253d2dcb5
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 43a498d3de1..b3675f24943 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -789,7 +789,14 @@ impl GitPanel {
let email = participant.user.email.clone().unwrap();
if !existing_co_authors.contains(&email.as_ref()) {
- new_co_authors.push((participant.user.github_login.clone(), email))
+ new_co_authors.push((
+ participant
+ .user
+ .name
+ .clone()
+ .unwrap_or_else(|| participant.user.github_login.clone()),
+ email,
+ ))
}
}
}
@@ -797,7 +804,12 @@ impl GitPanel {
if let Some(user) = room.local_participant_user(cx) {
if let Some(email) = user.email.clone() {
if !existing_co_authors.contains(&email.as_ref()) {
- new_co_authors.push((user.github_login.clone(), email.clone()))
+ new_co_authors.push((
+ user.name
+ .clone()
+ .unwrap_or_else(|| user.github_login.clone()),
+ email.clone(),
+ ))
}
}
}