Skip to content

Commit 423c642

Browse files
xwjdshappleboy
authored andcommitted
Bug fix for repo releases sorted (#3522) (#3555)
Signed-off-by: Wendell Sun <[email protected]> Use TimeStampNow function
1 parent ed2ba84 commit 423c642

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/release.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Release struct {
3636
IsPrerelease bool `xorm:"NOT NULL DEFAULT false"`
3737
IsTag bool `xorm:"NOT NULL DEFAULT false"`
3838
Attachments []*Attachment `xorm:"-"`
39-
CreatedUnix util.TimeStamp `xorm:"created INDEX"`
39+
CreatedUnix util.TimeStamp `xorm:"INDEX"`
4040
}
4141

4242
func (r *Release) loadAttributes(e Engine) error {
@@ -134,6 +134,8 @@ func createTag(gitRepo *git.Repository, rel *Release) error {
134134
if err != nil {
135135
return fmt.Errorf("CommitsCount: %v", err)
136136
}
137+
} else {
138+
rel.CreatedUnix = util.TimeStampNow()
137139
}
138140
return nil
139141
}

0 commit comments

Comments
 (0)