Skip to content

Commit

Permalink
Bug fix for repo releases sorted (#3522)
Browse files Browse the repository at this point in the history
Signed-off-by: Wendell Sun <[email protected]>

Use TimeStampNow function
  • Loading branch information
xwjdsh authored and appleboy committed Feb 21, 2018
1 parent 7b104f0 commit 2f5c1ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Release struct {
IsPrerelease bool `xorm:"NOT NULL DEFAULT false"`
IsTag bool `xorm:"NOT NULL DEFAULT false"`
Attachments []*Attachment `xorm:"-"`
CreatedUnix util.TimeStamp `xorm:"created INDEX"`
CreatedUnix util.TimeStamp `xorm:"INDEX"`
}

func (r *Release) loadAttributes(e Engine) error {
Expand Down Expand Up @@ -134,6 +134,8 @@ func createTag(gitRepo *git.Repository, rel *Release) error {
if err != nil {
return fmt.Errorf("CommitsCount: %v", err)
}
} else {
rel.CreatedUnix = util.TimeStampNow()
}
return nil
}
Expand Down

0 comments on commit 2f5c1ba

Please sign in to comment.