From 636253d2dcb500755a15bce34a215bace4752edc Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 11 Feb 2025 23:32:03 +0200 Subject: [PATCH] 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 --- crates/git_ui/src/git_panel.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 43a498d3de193aede3563213d70387b3570eb15d..b3675f249438fe212aeeda99b3c8e8468522ac23 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(), + )) } } }