Skip to content

Commit bf48f02

Browse files
Gustedearl-warren
authored andcommitted
[GITEA] Skip unsupported code comment
- If there's a code comment that's received during the migration that contains no diffhunk, skip it. This either means it was commenting on old diffhunk or it's just a general codecomment. Forgejo supports neither of such type of code comment. - Resolves https://codeberg.org/forgejo/forgejo/issues/1407 (cherry picked from commit ae463c7c559e02975ce5e758d8780def978eebee)
1 parent 821785d commit bf48f02

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

services/migrations/gitea_uploader.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,11 @@ func (g *GiteaLocalUploader) CreateReviews(reviews ...*base.Review) error {
859859
}
860860

861861
for _, comment := range review.Comments {
862+
// Skip code comment if it doesn't have a diff it is commeting on.
863+
if comment.DiffHunk == "" {
864+
continue
865+
}
866+
862867
line := comment.Line
863868
if line != 0 {
864869
comment.Position = 1

0 commit comments

Comments
 (0)