Skip to content

Commit

Permalink
Gitlab Migrator: dont ignore reactions of last request (go-gitea#16903)
Browse files Browse the repository at this point in the history
Backport go-gitea#16903

Fix bug related to early breaking when migrating reactions.
  • Loading branch information
6543 authored and zeripath committed Sep 1, 2021
1 parent cbe3ca5 commit fffa4bc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions modules/migrations/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,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++
}

Expand Down Expand Up @@ -558,12 +561,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++
}

Expand Down

0 comments on commit fffa4bc

Please sign in to comment.