1
0
Fork 0
forked from forgejo/forgejo

Remove GetRepositoryByRef and add GetRepositoryByOwnerAndName (#3043)

* remove GetRepositoryByRef and add GetRepositoryByOwnerAndName

* fix tests

* fix tests bug

* some improvements
This commit is contained in:
Lunny Xiao 2017-12-02 15:34:39 +08:00 committed by GitHub
parent 674422b642
commit 35cc5b0402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 66 deletions

View file

@ -572,9 +572,10 @@ func (err ErrLFSLockAlreadyExist) Error() string {
// ErrRepoNotExist represents a "RepoNotExist" kind of error.
type ErrRepoNotExist struct {
ID int64
UID int64
Name string
ID int64
UID int64
OwnerName string
Name string
}
// IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
@ -584,7 +585,8 @@ func IsErrRepoNotExist(err error) bool {
}
func (err ErrRepoNotExist) Error() string {
return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
return fmt.Sprintf("repository does not exist [id: %d, uid: %d, owner_name: %s, name: %s]",
err.ID, err.UID, err.OwnerName, err.Name)
}
// ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.