Skip to content

Commit

Permalink
Commit-Dropdown: Show Author of commit if available (go-gitea#30272) (g…
Browse files Browse the repository at this point in the history
…o-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>
  • Loading branch information
GiteaBot and sebastian-sauer authored Apr 5, 2024
1 parent db21481 commit c8570b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit c8570b7

Please sign in to comment.