diff options
author | Elias Norberg <elias@aisle.se> | 2019-04-02 21:54:29 +0200 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-02 15:54:29 -0400 |
commit | bf5af87eef8913004df63aef58f71628f9c057d0 (patch) | |
tree | 9f49b1076a95d0ebc961a71a3ebb5d146c5d64c3 /routers/repo | |
parent | 09fb036ad625ec5178319c30df47aac313fdbbe3 (diff) | |
download | gitea-bf5af87eef8913004df63aef58f71628f9c057d0.tar.gz gitea-bf5af87eef8913004df63aef58f71628f9c057d0.zip |
Show last commit status in pull request lists (#6465)
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 45033e67c2..42f3ddf4e8 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -214,6 +214,8 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB } } + var commitStatus = make(map[int64]*models.CommitStatus, len(issues)) + // Get posters. for i := range issues { // Check read status @@ -223,8 +225,14 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB ctx.ServerError("GetIsRead", err) return } + + if isPullOption == util.OptionalBoolTrue { + commitStatus[issues[i].PullRequest.ID], _ = issues[i].PullRequest.GetLastCommitStatus() + } } + ctx.Data["Issues"] = issues + ctx.Data["CommitStatus"] = commitStatus // Get assignees. ctx.Data["Assignees"], err = repo.GetAssignees() |