Skip to content

Commit 7430d06

Browse files
authored
Fix created_unix for mirroring (#32342) (#32406)
Fix #32233 Backport #32342
1 parent a3b7b98 commit 7430d06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/repository/repo.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,10 @@ func pullMirrorReleaseSync(ctx context.Context, repo *repo_model.Repository, git
340340

341341
for _, tag := range updates {
342342
if _, err := db.GetEngine(ctx).Where("repo_id = ? AND lower_tag_name = ?", repo.ID, strings.ToLower(tag.Name)).
343-
Cols("sha1").
343+
Cols("sha1", "created_unix").
344344
Update(&repo_model.Release{
345-
Sha1: tag.Object.String(),
345+
Sha1: tag.Object.String(),
346+
CreatedUnix: timeutil.TimeStamp(tag.Tagger.When.Unix()),
346347
}); err != nil {
347348
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)
348349
}

0 commit comments

Comments
 (0)