1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-02-06 11:02:19 +00:00

Merge a65f0f697040b6ec09f17713c7ab9239d725abd7 into 943cc4f98952431c4e95a62301d56bcc7b708338

This commit is contained in:
Abhishek Kumar Gupta 2025-02-05 23:48:36 -06:00 committed by GitHub
commit 67c10e10b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ func (d *DiffLine) GetHTMLDiffLineType() string {
// CanComment returns whether a line can get commented
func (d *DiffLine) CanComment() bool {
return len(d.Comments) == 0 && d.Type != DiffLineSection
return len(d.Comments) == 0
}
// GetCommentSide returns the comment side of the first comment, if not set returns empty string

View File

@ -616,7 +616,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())