MCPcopy Create free account
hub / github.com/gogs/gogs / GetRepositoryByName

Function GetRepositoryByName

internal/database/repo.go:1781–1793  ·  view source on GitHub ↗

GetRepositoryByName returns the repository by given name under user if exists. Deprecated: Use Repos.GetByName instead.

(ownerID int64, name string)

Source from the content-addressed store, hash-verified

1779// GetRepositoryByName returns the repository by given name under user if exists.
1780// Deprecated: Use Repos.GetByName instead.
1781func 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
1795func getRepositoryByID(e Engine, id int64) (*Repository, error) {
1796 repo := new(Repository)

Callers 8

RepoAssignmentFunction · 0.92
runServFunction · 0.92
TeamsRepoActionFunction · 0.92
parseOwnerAndRepoFunction · 0.92
GetRepositoryByParamsFunction · 0.92
PushUpdateFunction · 0.85
ChangeRepositoryNameFunction · 0.85
GetRepositoryByRefFunction · 0.85

Calls 2

LoadAttributesMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected