Skip to content

Commit

Permalink
Foreign ID conflicts if ID is 0 for each item (go-gitea#21271) (go-gi…
Browse files Browse the repository at this point in the history
…tea#21272)

The default is 0 if not defined, and that causes dupe index errors

Backport of go-gitea#21271
  • Loading branch information
tyroneyeh committed Oct 24, 2022
1 parent 242b898 commit 3b47dcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
},
}

if is.ForeignReference.ForeignIndex == "0" {
is.ForeignReference.ForeignIndex = strconv.FormatInt(is.Index, 10)
}

if err := g.remapUser(issue, &is); err != nil {
return err
}
Expand Down

0 comments on commit 3b47dcc

Please sign in to comment.