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

Follow-up of https://github.com/zed-industries/zed/pull/24575

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-02-11 23:32:03 +02:00 committed by GitHub
parent e851abd2ec
commit 636253d2dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(),
))
}
}
}