Skip to content

Commit 40377f3

Browse files
committed
improvements
1 parent 13ee43a commit 40377f3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

routers/web/repo/pull.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,16 +784,18 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
784784
return
785785
}
786786

787+
allComments := issues_model.CommentList{}
787788
for _, file := range diff.Files {
788789
for _, section := range file.Sections {
789790
for _, line := range section.Lines {
790-
if err := line.Comments.LoadAttachments(ctx); err != nil {
791-
ctx.ServerError("LoadAttachments", err)
792-
return
793-
}
791+
allComments = append(allComments, line.Comments...)
794792
}
795793
}
796794
}
795+
if err := allComments.LoadAttachments(ctx); err != nil {
796+
ctx.ServerError("LoadAttachments", err)
797+
return
798+
}
797799

798800
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
799801
if err != nil {

0 commit comments

Comments
 (0)