diff --git a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala index 48f0aa2..6703488 100644 --- a/src/main/scala/gitbucket/core/controller/PullRequestsController.scala +++ b/src/main/scala/gitbucket/core/controller/PullRequestsController.scala @@ -354,7 +354,15 @@ originRepository.owner, originRepository.name, oldId.getName, forkedRepository.owner, forkedRepository.name, newId.getName) + val title = if(commits.flatten.length == 1){ + commits.flatten.head.shortMessage + } else { + val text = forkedId.replaceAll("[\\-_]", " ") + text.substring(0, 1).toUpperCase + text.substring(1) + } + html.compare( + title, commits, diffs, (forkedRepository.repository.originUserName, forkedRepository.repository.originRepositoryName) match { diff --git a/src/main/twirl/gitbucket/core/pulls/compare.scala.html b/src/main/twirl/gitbucket/core/pulls/compare.scala.html index 0ba815f..047bbf0 100644 --- a/src/main/twirl/gitbucket/core/pulls/compare.scala.html +++ b/src/main/twirl/gitbucket/core/pulls/compare.scala.html @@ -1,4 +1,5 @@ -@(commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]], +@(title: String, + commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]], diffs: Seq[gitbucket.core.util.JGitUtil.DiffInfo], members: List[(String, String)], comments: List[gitbucket.core.model.Comment], @@ -56,7 +57,7 @@