File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,18 @@ import (
1616// RepositoryList contains a list of repositories
1717type RepositoryList []* Repository
1818
19+ func (repos RepositoryList ) Len () int {
20+ return len (repos )
21+ }
22+
23+ func (repos RepositoryList ) Less (i , j int ) bool {
24+ return repos [i ].FullName () < repos [j ].FullName ()
25+ }
26+
27+ func (repos RepositoryList ) Swap (i , j int ) {
28+ repos [i ], repos [j ] = repos [j ], repos [i ]
29+ }
30+
1931// RepositoryListOfMap make list from values of map
2032func RepositoryListOfMap (repoMap map [int64 ]* Repository ) RepositoryList {
2133 return RepositoryList (valuesRepository (repoMap ))
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ package user
77import (
88 "bytes"
99 "fmt"
10+ "sort"
1011
1112 "github.com/Unknwon/com"
1213 "github.com/Unknwon/paginater"
@@ -302,6 +303,7 @@ func Issues(ctx *context.Context) {
302303 }
303304
304305 showRepos := models .RepositoryListOfMap (showReposMap )
306+ sort .Sort (showRepos )
305307 if err = showRepos .LoadAttributes (); err != nil {
306308 ctx .Handle (500 , "LoadAttributes" , fmt .Errorf ("%v" , err ))
307309 return
You can’t perform that action at this time.
0 commit comments