Browse Source

sort

tags/v1.21.12.1
lewis 4 years ago
parent
commit
664fd0329b
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      routers/repo/view.go

+ 4
- 0
routers/repo/view.go View File

@@ -15,6 +15,7 @@ import (
"net/http"
"net/url"
"path"
"sort"
"strings"
"time"

@@ -964,6 +965,9 @@ func ContributorsAPI(ctx *context.Context) {
}
}
}
sort.Slice(contributorInfos, func(i, j int) bool {
return contributorInfos[i].CommitCnt > contributorInfos[j].CommitCnt
})
} else {
log.Error("GetContributors failed: %v", err)
errorCode = -1


Loading…
Cancel
Save