summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-25 20:35:56 -0400
committerUnknwon <u@gogs.io>2015-09-25 20:35:56 -0400
commit6dfee30bf0a6faef3211eb9fd1587c4fd8e87eef (patch)
tree0200056e4ad2bc5f7de3840429c17265ff0b0ce7 /models/repo.go
parent21e13cb51e73471d186b963e26404f89abd81fce (diff)
downloadgitea-6dfee30bf0a6faef3211eb9fd1587c4fd8e87eef.tar.gz
gitea-6dfee30bf0a6faef3211eb9fd1587c4fd8e87eef.zip
#1602 Wrong commit order on issue page when pushing multiple commits
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/models/repo.go b/models/repo.go
index 34de3d14db..f3a32d6877 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -777,19 +777,15 @@ func CountPublicRepositories() int64 {
}
// RepositoriesWithUsers returns number of repos in given page.
-func RepositoriesWithUsers(page, pageSize int) ([]*Repository, error) {
+func RepositoriesWithUsers(page, pageSize int) (_ []*Repository, err error) {
repos := make([]*Repository, 0, pageSize)
- if err := x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos); err != nil {
+ 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)
- if err != nil {
+ for i := range repos {
+ if err = repos[i].GetOwner(); err != nil {
return nil, err
- } else if !has {
- return nil, ErrUserNotExist{repo.OwnerID, ""}
}
}