Bläddra i källkod

Fix unused Engine bugs (#1064)

tags/v1.1.0
Ethan Koenig 7 år sedan
förälder
incheckning
136e6beb0f
2 ändrade filer med 4 tillägg och 4 borttagningar
  1. 1
    1
      models/attachment.go
  2. 3
    3
      models/repo.go

+ 1
- 1
models/attachment.go Visa fil

@@ -89,7 +89,7 @@ func NewAttachment(name string, buf []byte, file multipart.File) (_ *Attachment,

func getAttachmentByUUID(e Engine, uuid string) (*Attachment, error) {
attach := &Attachment{UUID: uuid}
has, err := x.Get(attach)
has, err := e.Get(attach)
if err != nil {
return nil, err
} else if !has {

+ 3
- 3
models/repo.go Visa fil

@@ -1734,15 +1734,15 @@ func GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
}

func getRepositoryCount(e Engine, u *User) (int64, error) {
return x.Count(&Repository{OwnerID: u.ID})
return e.Count(&Repository{OwnerID: u.ID})
}

func getPublicRepositoryCount(e Engine, u *User) (int64, error) {
return x.Where("is_private = ?", false).Count(&Repository{OwnerID: u.ID})
return e.Where("is_private = ?", false).Count(&Repository{OwnerID: u.ID})
}

func getPrivateRepositoryCount(e Engine, u *User) (int64, error) {
return x.Where("is_private = ?", true).Count(&Repository{OwnerID: u.ID})
return e.Where("is_private = ?", true).Count(&Repository{OwnerID: u.ID})
}

// GetRepositoryCount returns the total number of repositories of user.

Laddar…
Avbryt
Spara