diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-12-11 18:20:11 -0600 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-12 08:20:11 +0800 |
commit | 382936a668c48b3c83fe80cdf138f76fb74a5f8f (patch) | |
tree | 79ec4ab3342a4218d53ae246da39819b7b7952ed /modules/migrations/gitea.go | |
parent | 3bf5a07537a53c6903b39268559c5c76bee85c12 (diff) | |
download | gitea-382936a668c48b3c83fe80cdf138f76fb74a5f8f.tar.gz gitea-382936a668c48b3c83fe80cdf138f76fb74a5f8f.zip |
Add SyncTags to uploader interface (#9326)
* Add sync tags to interface
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix revive
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules/migrations/gitea.go')
-rw-r--r-- | modules/migrations/gitea.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/migrations/gitea.go b/modules/migrations/gitea.go index 617561194d..18f4da7584 100644 --- a/modules/migrations/gitea.go +++ b/modules/migrations/gitea.go @@ -201,7 +201,7 @@ func (g *GiteaLocalUploader) CreateLabels(labels ...*base.Label) error { } // CreateReleases creates releases -func (g *GiteaLocalUploader) CreateReleases(syncTags bool, releases ...*base.Release) error { +func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error { var rels = make([]*models.Release, 0, len(releases)) for _, release := range releases { var rel = models.Release{ @@ -288,16 +288,13 @@ func (g *GiteaLocalUploader) CreateReleases(syncTags bool, releases ...*base.Rel rels = append(rels, &rel) } - if err := models.InsertReleases(rels...); err != nil { - return err - } - if syncTags { - // sync tags to releases in database - return models.SyncReleasesWithTags(g.repo, g.gitRepo) - } + return models.InsertReleases(rels...) +} - return nil +// SyncTags syncs releases with tags in the database +func (g *GiteaLocalUploader) SyncTags() error { + return models.SyncReleasesWithTags(g.repo, g.gitRepo) } // CreateIssues creates issues |