diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index f50a068..0f7f50c 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -328,9 +328,10 @@ .map(commit => getCommitComments(userName, repositoryName, commit.id, true)) .flatten ++ getComments(userName, repositoryName, issueId)) .groupBy { - case x: IssueComment => (Some(x.commentId), None, None, None) - case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine) - case x => throw new MatchError(x) + case x: IssueComment => (Some(x.commentId), None, None, None) + case x: CommitComment if x.fileName.isEmpty => (Some(x.commentId), None, None, None) + case x: CommitComment => (None, x.fileName, x.oldLine, x.newLine) + case x => throw new MatchError(x) } .toSeq .map { @@ -353,9 +354,6 @@ newLine ) ) - // Comment on a specific commit - case (_, comments) => - comments.head // TODO In this case, something wrong in the presentation of the comments list. } .sortWith(_.registeredDate before _.registeredDate) } diff --git a/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html b/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html index cbfbc8a..945acdc 100644 --- a/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html +++ b/src/main/twirl/gitbucket/core/helper/commitcomments.scala.html @@ -6,9 +6,6 @@