diff --git a/routers/repo/view.go b/routers/repo/view.go index cd59ec920..8b9039087 100755 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -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