Skip to content

Commit cbebcc1

Browse files
Foreign ID conflicts if ID is 0 for each item (#21271) (#21272)
The default is 0 if not defined, and that causes dupe index errors Backport of #21271
1 parent 0e677d7 commit cbebcc1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: services/migrations/gitea_uploader.go

+4
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,10 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
412412
},
413413
}
414414

415+
if is.ForeignReference.ForeignIndex == "0" {
416+
is.ForeignReference.ForeignIndex = strconv.FormatInt(is.Index, 10)
417+
}
418+
415419
if err := g.remapUser(issue, &is); err != nil {
416420
return err
417421
}

0 commit comments

Comments
 (0)