Skip to content

Commit c8570b7

Browse files
Commit-Dropdown: Show Author of commit if available (go-gitea#30272) (go-gitea#30285)
Backport go-gitea#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: ![Screenshot from 2024-04-03 22-34-41](https://github.com/go-gitea/gitea/assets/1135157/1c7c5c19-6d0a-4176-8a87-7bca6a0c6dc8) and the same contents in our dropdown: ![image](https://github.com/go-gitea/gitea/assets/1135157/aa094af2-c369-47ac-9c27-ca208d1d03f0) fixes go-gitea#29588 Co-authored-by: sebastian-sauer <sauer.sebastian@gmail.com>
1 parent db21481 commit c8570b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/pull/pull.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,12 @@ func GetPullCommits(ctx *gitea_context.Context, issue *issues_model.Issue) ([]Co
989989
for _, commit := range prInfo.Commits {
990990
var committerOrAuthorName string
991991
var commitTime time.Time
992-
if commit.Committer != nil {
993-
committerOrAuthorName = commit.Committer.Name
994-
commitTime = commit.Committer.When
995-
} else {
992+
if commit.Author != nil {
996993
committerOrAuthorName = commit.Author.Name
997994
commitTime = commit.Author.When
995+
} else {
996+
committerOrAuthorName = commit.Committer.Name
997+
commitTime = commit.Committer.When
998998
}
999999

10001000
commits = append(commits, CommitInfo{

0 commit comments

Comments
 (0)