diff options
Diffstat (limited to 'routers/repo/release.go')
-rw-r--r-- | routers/repo/release.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index 3e2449ecf3..27df3f6d16 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -23,7 +23,12 @@ func (rs *ReleaseSorter) Len() int { } func (rs *ReleaseSorter) Less(i, j int) bool { - return rs.rels[i].NumCommits > rs.rels[j].NumCommits + diffNum := rs.rels[i].NumCommits - rs.rels[j].NumCommits + if diffNum != 0 { + return diffNum > 0 + } + + return rs.rels[i].Created.Second() > rs.rels[j].Created.Second() } func (rs *ReleaseSorter) Swap(i, j int) { |