mirror of
https://github.com/go-gitea/gitea
synced 2025-02-26 23:04:18 +00:00
Backport #33585 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
cc6ec56738
commit
5e9cc919cf
@ -86,9 +86,11 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
|
|||||||
ids = append(ids, comment.ReviewID)
|
ids = append(ids, comment.ReviewID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(ids) > 0 {
|
||||||
if err := e.In("id", ids).Find(&reviews); err != nil {
|
if err := e.In("id", ids).Find(&reviews); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
n := 0
|
n := 0
|
||||||
for _, comment := range comments {
|
for _, comment := range comments {
|
||||||
|
@ -785,18 +785,18 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allComments := issues_model.CommentList{}
|
||||||
for _, file := range diff.Files {
|
for _, file := range diff.Files {
|
||||||
for _, section := range file.Sections {
|
for _, section := range file.Sections {
|
||||||
for _, line := range section.Lines {
|
for _, line := range section.Lines {
|
||||||
for _, comment := range line.Comments {
|
allComments = append(allComments, line.Comments...)
|
||||||
if err := comment.LoadAttachments(ctx); err != nil {
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err := allComments.LoadAttachments(ctx); err != nil {
|
||||||
ctx.ServerError("LoadAttachments", err)
|
ctx.ServerError("LoadAttachments", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
|
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -80,7 +80,7 @@ type DiffLine struct {
|
|||||||
Match int
|
Match int
|
||||||
Type DiffLineType
|
Type DiffLineType
|
||||||
Content string
|
Content string
|
||||||
Comments []*issues_model.Comment
|
Comments issues_model.CommentList
|
||||||
SectionInfo *DiffLineSectionInfo
|
SectionInfo *DiffLineSectionInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user