[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)
(cherry picked from commit bf48f02a86d6a193417f13a77031b8207a173dca)
(cherry picked from commit 10c3f102fa9135de37e9f73137ae5a9cf7072635)
(cherry picked from commit 828b4cc10cd0fc7e2540fe75e88b6ebf978c5c84)
(cherry picked from commit 6427fa65b641a32ead53779e3e7bda97704567df)
(cherry picked from commit 5b7a43c43fed0eb39e84edd652a699461f14fbbb)
(cherry picked from commit 49eb2566488a4857b2d2d2b0bd1d692c39beb028)
(cherry picked from commit 0be26ca144518f5961f88c0da99e37270bfb0005)
(cherry picked from commit c083236a589ae100128ba66b704c18fcd16201cf)
(cherry picked from commit 85738bc0a1)
This commit is contained in:
Gusted 2023-09-17 20:25:30 +02:00 committed by Earl Warren
parent 6836149d45
commit b39452fc1d
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -859,6 +859,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