diff --git a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala index 3cbd887..2f93024 100644 --- a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala +++ b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala @@ -113,7 +113,7 @@ val name = repository.name getPullRequest(owner, name, issueId) map { case (issue, pullreq) => - val (commits, _) = + val (commits, diffs) = getRequestCompareInfo(owner, name, pullreq.commitIdFrom, owner, name, pullreq.commitIdTo) html.conversation( @@ -121,6 +121,7 @@ pullreq, commits.flatten, getPullRequestComments(owner, name, issue.issueId, commits.flatten), + diffs.size, getIssueLabels(owner, name, issueId), getAssignableUserNames(owner, name), getMilestonesWithIssueCount(owner, name), @@ -157,23 +158,25 @@ }) get("/:owner/:repository/pull/:id/commits")(referrersOnly { repository => - params("id").toIntOpt.flatMap { issueId => - val owner = repository.owner - val name = repository.name - getPullRequest(owner, name, issueId) map { - case (issue, pullreq) => - val (commits, _) = - getRequestCompareInfo(owner, name, pullreq.commitIdFrom, owner, name, pullreq.commitIdTo) + params("id").toIntOpt.flatMap { + issueId => + val owner = repository.owner + val name = repository.name + getPullRequest(owner, name, issueId) map { + case (issue, pullreq) => + val (commits, diffs) = + getRequestCompareInfo(owner, name, pullreq.commitIdFrom, owner, name, pullreq.commitIdTo) - html.commits( - issue, - pullreq, - commits, - getPullRequestComments(owner, name, issue.issueId, commits.flatten), - isManageable(repository), - repository - ) - } + html.commits( + issue, + pullreq, + commits, + getPullRequestComments(owner, name, issue.issueId, commits.flatten), + diffs.size, + isManageable(repository), + repository + ) + } } getOrElse NotFound() }) diff --git a/src/main/twirl/gitbucket/core/pulls/commits.scala.html b/src/main/twirl/gitbucket/core/pulls/commits.scala.html index 1a52757..a21fc6a 100644 --- a/src/main/twirl/gitbucket/core/pulls/commits.scala.html +++ b/src/main/twirl/gitbucket/core/pulls/commits.scala.html @@ -2,10 +2,11 @@ pullreq: gitbucket.core.model.PullRequest, commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]], comments: Seq[gitbucket.core.model.Comment], + changedFileSize: Int, isManageable: Boolean, repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers -@gitbucket.core.pulls.html.menu("commits", issue, pullreq, commits.flatten, comments, isManageable, repository){ +@gitbucket.core.pulls.html.menu("commits", issue, pullreq, commits.flatten, comments, changedFileSize, isManageable, repository){