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

Function getRepositoryByID

internal/database/repo.go:1795–1804  ·  view source on GitHub ↗
(e Engine, id int64)

Source from the content-addressed store, hash-verified

1793}
1794
1795func getRepositoryByID(e Engine, id int64) (*Repository, error) {
1796 repo := new(Repository)
1797 has, err := e.ID(id).Get(repo)
1798 if err != nil {
1799 return nil, err
1800 } else if !has {
1801 return nil, ErrRepoNotExist{args: map[string]any{"repoID": id}}
1802 }
1803 return repo, repo.loadAttributes(e)
1804}
1805
1806// GetRepositoryByID returns the repository by given id if exists.
1807func GetRepositoryByID(id int64) (*Repository, error) {

Callers 8

loadAttributesMethod · 0.85
loadAttributesMethod · 0.85
loadAttributesMethod · 0.85
getRepositoriesMethod · 0.85
loadAttributesMethod · 0.85
initRepositoryFunction · 0.85
GetRepositoryByIDFunction · 0.85
loadAttributesMethod · 0.85

Calls 3

GetMethod · 0.65
IDMethod · 0.65
loadAttributesMethod · 0.45

Tested by

no test coverage detected