[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
This commit is contained in:
Gusted 2023-09-17 20:25:30 +02:00 committed by Gusted
parent 35f29c28bf
commit ae463c7c55

View file

@ -860,6 +860,11 @@ func (g *GiteaLocalUploader) CreateReviews(reviews ...*base.Review) error {
}
for _, comment := range review.Comments {
// Skip code comment if it doesn't have a diff it is commeting on.
if comment.DiffHunk == "" {
continue
}
line := comment.Line
if line != 0 {
comment.Position = 1