mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-13 01:12:36 -04:00
Merge a65f0f697040b6ec09f17713c7ab9239d725abd7 into 355e9a9d544aa2d3f3a17b06cdb2bf1ceb290fd7
This commit is contained in:
commit
9d15adf915
@ -130,7 +130,7 @@ func (d *DiffLine) GetHTMLDiffLineType() string {
|
|||||||
|
|
||||||
// CanComment returns whether a line can get commented
|
// CanComment returns whether a line can get commented
|
||||||
func (d *DiffLine) CanComment() bool {
|
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
|
// GetCommentSide returns the comment side of the first comment, if not set returns empty string
|
||||||
|
@ -586,7 +586,7 @@ func TestDiff_LoadCommentsWithOutdated(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDiffLine_CanComment(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.False(t, (&DiffLine{Type: DiffLineAdd, Comments: []*issues_model.Comment{{Content: "bla"}}}).CanComment())
|
||||||
assert.True(t, (&DiffLine{Type: DiffLineAdd}).CanComment())
|
assert.True(t, (&DiffLine{Type: DiffLineAdd}).CanComment())
|
||||||
assert.True(t, (&DiffLine{Type: DiffLineDel}).CanComment())
|
assert.True(t, (&DiffLine{Type: DiffLineDel}).CanComment())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user