diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-12 09:35:51 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-12 09:35:51 -0400 |
commit | fb0972afadbd87ae707861acc0986bde01528c3c (patch) | |
tree | 83cc2a8562ebb255e11702b32d0c4b06962b45f1 /routers/repo/release.go | |
parent | 9961f9a53c4e3be1b224ad618b35c175143a0daa (diff) | |
download | gitea-fb0972afadbd87ae707861acc0986bde01528c3c.tar.gz gitea-fb0972afadbd87ae707861acc0986bde01528c3c.zip |
Fix #199
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) { |