aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repository/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-11-01 23:11:38 -0700
committerGitHub <noreply@github.com>2024-11-02 06:11:38 +0000
commit13a203828c40f9ad1005b16b4ae26256a7df8263 (patch)
tree111125f082b4d33c4ec4a8395df40a7f94d6094b /modules/repository/repo.go
parentfec6b3d50072e48bb51c18c5c4ea682dc6319573 (diff)
downloadgitea-13a203828c40f9ad1005b16b4ae26256a7df8263.tar.gz
gitea-13a203828c40f9ad1005b16b4ae26256a7df8263.zip
Fix created_unix for mirroring (#32342)
Fix #32233
Diffstat (limited to 'modules/repository/repo.go')
-rw-r--r--modules/repository/repo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/repository/repo.go b/modules/repository/repo.go
index 3d1899b2fe..def2220b17 100644
--- a/modules/repository/repo.go
+++ b/modules/repository/repo.go
@@ -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)
}