aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r--routers/repo/pull.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index bee3bbc1df..901a668632 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -325,6 +325,20 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
}
ctx.Data["NumCommits"] = compareInfo.Commits.Len()
ctx.Data["NumFiles"] = compareInfo.NumFiles
+
+ if compareInfo.Commits.Len() != 0 {
+ sha := compareInfo.Commits.Front().Value.(*git.Commit).ID.String()
+ commitStatuses, err := models.GetLatestCommitStatus(ctx.Repo.Repository.ID, sha, models.ListOptions{})
+ if err != nil {
+ ctx.ServerError("GetLatestCommitStatus", err)
+ return nil
+ }
+ if len(commitStatuses) != 0 {
+ ctx.Data["LatestCommitStatuses"] = commitStatuses
+ ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(commitStatuses)
+ }
+ }
+
return compareInfo
}