Browse Source

Merge pull request '贡献者列表按照commit数量降序展示' (#774) from fix-224 into V20211115

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/774
pull/792/head
lewis 3 years ago
parent
commit
0823e2ffdd
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/http"
"net/url" "net/url"
"path" "path"
"sort"
"strings" "strings"
"time" "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 { } else {
log.Error("GetContributors failed: %v", err) log.Error("GetContributors failed: %v", err)
errorCode = -1 errorCode = -1


Loading…
Cancel
Save