forked from forgejo/forgejo
#1693 minor fix
This commit is contained in:
parent
84c727ae66
commit
986447335d
5 changed files with 8 additions and 28 deletions
|
@ -775,13 +775,14 @@ func CountRepositories() int64 {
|
|||
func CountPublicRepositories() int64 {
|
||||
return countRepositories(false)
|
||||
}
|
||||
|
||||
// RepositoriesWithUsers returns number of repos in given page.
|
||||
func RepositoriesWithUsers(page, pageSize int) ([]*Repository, error) {
|
||||
repos := make([]*Repository, 0, pageSize)
|
||||
if err := x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
for _, repo := range repos {
|
||||
repo.Owner = &User{Id: repo.OwnerID}
|
||||
has, err := x.Get(repo.Owner)
|
||||
|
@ -793,7 +794,6 @@ func RepositoriesWithUsers(page, pageSize int) ([]*Repository, error) {
|
|||
}
|
||||
|
||||
return repos, nil
|
||||
|
||||
}
|
||||
|
||||
// RepoPath returns repository path by given user and repository name.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue