1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-09-04 20:33:45 +00:00

Foreign ID conflicts if ID is 0 for each item () ()

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

Backport of 
This commit is contained in:
techknowlogick
2022-10-02 17:43:30 -04:00
committed by GitHub
parent 0e677d7b41
commit cbebcc1c26

@@ -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 { if err := g.remapUser(issue, &is); err != nil {
return err return err
} }