]> source.dussan.org Git - gitea.git/commitdiff
Fix created_unix for mirroring (#32342)
authorLunny Xiao <xiaolunwen@gmail.com>
Sat, 2 Nov 2024 06:11:38 +0000 (23:11 -0700)
committerGitHub <noreply@github.com>
Sat, 2 Nov 2024 06:11:38 +0000 (06:11 +0000)
Fix #32233

modules/repository/repo.go

index 3d1899b2fe006fe7082f0cc9cdb1e4f24649985d..def2220b17d12554ff9e3774aa8769ce739551ed 100644 (file)
@@ -340,9 +340,10 @@ func pullMirrorReleaseSync(ctx context.Context, repo *repo_model.Repository, git
 
                for _, tag := range updates {
                        if _, err := db.GetEngine(ctx).Where("repo_id = ? AND lower_tag_name = ?", repo.ID, strings.ToLower(tag.Name)).
-                               Cols("sha1").
+                               Cols("sha1", "created_unix").
                                Update(&repo_model.Release{
-                                       Sha1: tag.Object.String(),
+                                       Sha1:        tag.Object.String(),
+                                       CreatedUnix: timeutil.TimeStamp(tag.Tagger.When.Unix()),
                                }); err != nil {
                                return fmt.Errorf("unable to update tag %s for pull-mirror Repo[%d:%s/%s]: %w", tag.Name, repo.ID, repo.OwnerName, repo.Name, err)
                        }