Backport #22591 Importing labels (via `gitea restore-repo`) did not split them up into batches properly. The first "batch" would create all labels, the second "batch" would create all labels except those in the first "batch", etc. This meant that when importing more than 99 labels (the batch size) there would always be duplicate ones. This is solved by actually passing `labels[:lbBatchSize]` to the `CreateLabels()` function, instead of the entire list `labels`. Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
This commit is contained in:
parent
f6cb7860a2
commit
f204ff4ef7
1 changed files with 1 additions and 1 deletions
|
@ -282,7 +282,7 @@ func migrateRepository(doer *user_model.User, downloader base.Downloader, upload
|
||||||
lbBatchSize = len(labels)
|
lbBatchSize = len(labels)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := uploader.CreateLabels(labels...); err != nil {
|
if err := uploader.CreateLabels(labels[:lbBatchSize]...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
labels = labels[lbBatchSize:]
|
labels = labels[lbBatchSize:]
|
||||||
|
|
Loading…
Reference in a new issue