GetRepositoryByName returns the repository by given name under user if exists. Deprecated: Use Repos.GetByName instead.
(ownerID int64, name string)
| 1779 | // GetRepositoryByName returns the repository by given name under user if exists. |
| 1780 | // Deprecated: Use Repos.GetByName instead. |
| 1781 | func GetRepositoryByName(ownerID int64, name string) (*Repository, error) { |
| 1782 | repo := &Repository{ |
| 1783 | OwnerID: ownerID, |
| 1784 | LowerName: strings.ToLower(name), |
| 1785 | } |
| 1786 | has, err := x.Get(repo) |
| 1787 | if err != nil { |
| 1788 | return nil, err |
| 1789 | } else if !has { |
| 1790 | return nil, ErrRepoNotExist{args: map[string]any{"ownerID": ownerID, "name": name}} |
| 1791 | } |
| 1792 | return repo, repo.LoadAttributes() |
| 1793 | } |
| 1794 | |
| 1795 | func getRepositoryByID(e Engine, id int64) (*Repository, error) { |
| 1796 | repo := new(Repository) |
no test coverage detected