]> source.dussan.org Git - gitea.git/commitdiff
Show commit history for closed/merged PRs (#24238) (#24261)
authorGiteabot <teabot@gitea.io>
Fri, 21 Apr 2023 18:15:00 +0000 (14:15 -0400)
committerGitHub <noreply@github.com>
Fri, 21 Apr 2023 18:15:00 +0000 (14:15 -0400)
Backport #24238 by @wxiaoguang

Close #24237

Before:

<details>

![image](https://user-images.githubusercontent.com/2114189/233424875-a69c6dad-df4a-483e-b796-36c6459af2d6.png)

</details>

After:

![image](https://user-images.githubusercontent.com/2114189/233424712-60a296de-017b-49a8-89b2-5925ff452646.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
routers/web/repo/issue.go

index 018925b8d18e770808a60eee8a2b9c609bcff46b..3868e895f0a5d343ed4ac22ec0918ba117192e68 100644 (file)
@@ -1627,8 +1627,10 @@ func ViewIssue(ctx *context.Context) {
                        comment.Type == issues_model.CommentTypeStopTracking {
                        // drop error since times could be pruned from DB..
                        _ = comment.LoadTime()
-               } else if comment.Type == issues_model.CommentTypeClose {
-                       // record ID of latest closed comment.
+               }
+
+               if comment.Type == issues_model.CommentTypeClose || comment.Type == issues_model.CommentTypeMergePull {
+                       // record ID of the latest closed/merged comment.
                        // if PR is closed, the comments whose type is CommentTypePullRequestPush(29) after latestCloseCommentID won't be rendered.
                        latestCloseCommentID = comment.ID
                }