git: Display author not committer in git popover (#27628)
Display Author name/email instead of Committer name/email in git popover. Closes https://github.com/zed-industries/zed/issues/27625 Prior to v0.173.x, Zed displayed Author name. Regression introduced in: - https://github.com/zed-industries/zed/pull/24593 Release Notes: - git: Switch to displaying Git author instead of Git committer in Git Blame popover.
This commit is contained in:
parent
84dd2366bc
commit
93c0056065
2 changed files with 9 additions and 13 deletions
|
@ -20,8 +20,8 @@ use crate::hover_popover::hover_markdown_style;
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct CommitDetails {
|
pub struct CommitDetails {
|
||||||
pub sha: SharedString,
|
pub sha: SharedString,
|
||||||
pub committer_name: SharedString,
|
pub author_name: SharedString,
|
||||||
pub committer_email: SharedString,
|
pub author_email: SharedString,
|
||||||
pub commit_time: OffsetDateTime,
|
pub commit_time: OffsetDateTime,
|
||||||
pub message: Option<ParsedCommitMessage>,
|
pub message: Option<ParsedCommitMessage>,
|
||||||
}
|
}
|
||||||
|
@ -133,16 +133,12 @@ impl CommitTooltip {
|
||||||
CommitDetails {
|
CommitDetails {
|
||||||
sha: blame.sha.to_string().into(),
|
sha: blame.sha.to_string().into(),
|
||||||
commit_time,
|
commit_time,
|
||||||
committer_name: blame
|
author_name: blame
|
||||||
.committer_name
|
.author
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or("<no name>".to_string())
|
.unwrap_or("<no name>".to_string())
|
||||||
.into(),
|
.into(),
|
||||||
committer_email: blame
|
author_email: blame.author_mail.clone().unwrap_or("".to_string()).into(),
|
||||||
.committer_email
|
|
||||||
.clone()
|
|
||||||
.unwrap_or("".to_string())
|
|
||||||
.into(),
|
|
||||||
message: details,
|
message: details,
|
||||||
},
|
},
|
||||||
window,
|
window,
|
||||||
|
@ -180,9 +176,9 @@ impl Render for CommitTooltip {
|
||||||
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
let avatar = CommitAvatar::new(&self.commit).render(window, cx);
|
let avatar = CommitAvatar::new(&self.commit).render(window, cx);
|
||||||
|
|
||||||
let author = self.commit.committer_name.clone();
|
let author = self.commit.author_name.clone();
|
||||||
|
|
||||||
let author_email = self.commit.committer_email.clone();
|
let author_email = self.commit.author_email.clone();
|
||||||
|
|
||||||
let short_commit_id = self
|
let short_commit_id = self
|
||||||
.commit
|
.commit
|
||||||
|
|
|
@ -3951,8 +3951,8 @@ impl GitPanelMessageTooltip {
|
||||||
|
|
||||||
let commit_details = editor::commit_tooltip::CommitDetails {
|
let commit_details = editor::commit_tooltip::CommitDetails {
|
||||||
sha: details.sha.clone(),
|
sha: details.sha.clone(),
|
||||||
committer_name: details.committer_name.clone(),
|
author_name: details.committer_name.clone(),
|
||||||
committer_email: details.committer_email.clone(),
|
author_email: details.committer_email.clone(),
|
||||||
commit_time: OffsetDateTime::from_unix_timestamp(details.commit_timestamp)?,
|
commit_time: OffsetDateTime::from_unix_timestamp(details.commit_timestamp)?,
|
||||||
message: Some(editor::commit_tooltip::ParsedCommitMessage {
|
message: Some(editor::commit_tooltip::ParsedCommitMessage {
|
||||||
message: details.message.clone(),
|
message: details.message.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue