]> source.dussan.org Git - gitea.git/commitdiff
Commit-Dropdown: Show Author of commit if available (#30272)
authorsebastian-sauer <sauer.sebastian@gmail.com>
Fri, 5 Apr 2024 00:51:53 +0000 (02:51 +0200)
committerGitHub <noreply@github.com>
Fri, 5 Apr 2024 00:51:53 +0000 (00:51 +0000)
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 #29588

services/pull/pull.go

index c091b8608a06611241af972d502d3038b3c34b9a..185a1895c9fb85ea833104f7b491fed95d2e9a7d 100644 (file)
@@ -989,12 +989,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{