aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-09-20 08:26:49 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-09-20 13:26:49 +0800
commit7a0297819d3aececb8b633de5a2995c40b7bfcae (patch)
tree7aed967ad21f95df2b16359ec1551662d653a1fd /models/repo.go
parent8b6236d67b21f2a3291207ef77d103a3ce7476ba (diff)
downloadgitea-7a0297819d3aececb8b633de5a2995c40b7bfcae.tar.gz
gitea-7a0297819d3aececb8b633de5a2995c40b7bfcae.zip
Sync releases table with tags on push and for mirrors (#2459)
* Sync releases table with tags on push and for mirrors * Code style fixes * Fix api to return only releases * Optimize release creation and update Minimize posibility of race conditions * Fix release lower tag name updating * handle tag reference update by addionally comparing commit id
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 4c844d9b56..cdaf943944 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -940,6 +940,10 @@ func MigrateRepository(doer, u *User, opts MigrateRepoOptions) (*Repository, err
if headBranch != nil {
repo.DefaultBranch = headBranch.Name
}
+
+ if err = SyncReleasesWithTags(repo, gitRepo); err != nil {
+ log.Error(4, "Failed to synchronize tags to releases for repository: %v", err)
+ }
}
if err = repo.UpdateSize(); err != nil {