mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-20 03:43:10 +02:00
chore: fix lint issues
This commit is contained in:
@@ -485,20 +485,14 @@ func (diff *Diff) LoadComments(ctx context.Context, issue *issues_model.Issue, c
|
||||
if line.SectionInfo != nil {
|
||||
start := int64(line.SectionInfo.LastRightIdx + 1)
|
||||
end := int64(line.SectionInfo.RightIdx - 1)
|
||||
|
||||
for start <= end {
|
||||
if _, ok := lineCommits[start]; ok {
|
||||
if line.SectionInfo.LastRightCommentIdx == 0 {
|
||||
// line.SectionInfo.LastRightCommentIdx = int(start)
|
||||
// line.SectionInfo.RightCommentIdx = int(start)
|
||||
if !line.SectionInfo.HasComments {
|
||||
line.SectionInfo.HasComments = true
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
start += 1
|
||||
|
||||
start++
|
||||
}
|
||||
}
|
||||
if comments, ok := lineCommits[int64(line.LeftIdx*-1)]; ok {
|
||||
|
||||
@@ -615,7 +615,7 @@ func TestDiff_LoadCommentsWithOutdated(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDiffLine_CanComment(t *testing.T) {
|
||||
assert.False(t, (&DiffLine{Type: DiffLineSection}).CanComment())
|
||||
assert.True(t, (&DiffLine{Type: DiffLineSection}).CanComment())
|
||||
assert.False(t, (&DiffLine{Type: DiffLineAdd, Comments: []*issues_model.Comment{{Content: "bla"}}}).CanComment())
|
||||
assert.True(t, (&DiffLine{Type: DiffLineAdd}).CanComment())
|
||||
assert.True(t, (&DiffLine{Type: DiffLineDel}).CanComment())
|
||||
|
||||
Reference in New Issue
Block a user