aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-09-01 12:20:19 +0200
committerGitHub <noreply@github.com>2021-09-01 11:20:19 +0100
commit7062614deeb7dd76a6a0a0426e5cce96055e9a0c (patch)
tree6d6c890ae63b63cb5244e51f63dee5205aff3cb3
parent57b0887ab21aaee9a70638df70f6dec0f72098c4 (diff)
downloadgitea-7062614deeb7dd76a6a0a0426e5cce96055e9a0c.tar.gz
gitea-7062614deeb7dd76a6a0a0426e5cce96055e9a0c.zip
Gitlab Migrator: dont ignore reactions of last request (#16903)
Fix bug related to early breaking when migrating reactions.
-rw-r--r--modules/migrations/gitlab.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/migrations/gitlab.go b/modules/migrations/gitlab.go
index d5bf2d2d76..91ba073d18 100644
--- a/modules/migrations/gitlab.go
+++ b/modules/migrations/gitlab.go
@@ -421,12 +421,15 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er
if err != nil {
return nil, false, fmt.Errorf("error while listing issue awards: %v", err)
}
- if len(awards) < perPage {
- break
- }
+
for i := range awards {
reactions = append(reactions, g.awardToReaction(awards[i]))
}
+
+ if len(awards) < perPage {
+ break
+ }
+
awardPage++
}
@@ -584,12 +587,15 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
if err != nil {
return nil, false, fmt.Errorf("error while listing merge requests awards: %v", err)
}
- if len(awards) < perPage {
- break
- }
+
for i := range awards {
reactions = append(reactions, g.awardToReaction(awards[i]))
}
+
+ if len(awards) < perPage {
+ break
+ }
+
awardPage++
}