mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix unused Engine bugs (#1064)
This commit is contained in:
		@@ -89,7 +89,7 @@ func NewAttachment(name string, buf []byte, file multipart.File) (_ *Attachment,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func getAttachmentByUUID(e Engine, uuid string) (*Attachment, error) {
 | 
					func getAttachmentByUUID(e Engine, uuid string) (*Attachment, error) {
 | 
				
			||||||
	attach := &Attachment{UUID: uuid}
 | 
						attach := &Attachment{UUID: uuid}
 | 
				
			||||||
	has, err := x.Get(attach)
 | 
						has, err := e.Get(attach)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	} else if !has {
 | 
						} else if !has {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1734,15 +1734,15 @@ func GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getRepositoryCount(e Engine, u *User) (int64, 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) {
 | 
					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) {
 | 
					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.
 | 
					// GetRepositoryCount returns the total number of repositories of user.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user