From 8a9b57500c4ebba883887e6dcca54b88fc82c6a2 Mon Sep 17 00:00:00 2001 From: Giteabot <teabot@gitea.io> Date: Fri, 5 Apr 2024 10:00:20 +0800 Subject: [PATCH] Commit-Dropdown: Show Author of commit if available (#30272) (#30285) Backport #30272 by @sebastian-sauer As in commits page we show the author of the commit in the commits dropdown and not the committer. Commits Page:  and the same contents in our dropdown:  fixes #29588 Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com> (cherry picked from commit c8570b73afb443f8e4f07f0a26939f1ab5c18f94) --- services/pull/pull.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/pull/pull.go b/services/pull/pull.go index fb4b88309a..3d0d38f488 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -967,12 +967,12 @@ func GetPullCommits(ctx *gitea_context.Context, issue *issues_model.Issue) ([]Co for _, commit := range prInfo.Commits { var committerOrAuthorName string var commitTime time.Time - if commit.Committer != nil { - committerOrAuthorName = commit.Committer.Name - commitTime = commit.Committer.When - } else { + if commit.Author != nil { committerOrAuthorName = commit.Author.Name commitTime = commit.Author.When + } else { + committerOrAuthorName = commit.Committer.Name + commitTime = commit.Committer.When } commits = append(commits, CommitInfo{