diff options
Diffstat (limited to 'models/repo/fork.go')
-rw-r--r-- | models/repo/fork.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/models/repo/fork.go b/models/repo/fork.go index ae7882a02e..b48126253c 100644 --- a/models/repo/fork.go +++ b/models/repo/fork.go @@ -10,18 +10,14 @@ import ( "code.gitea.io/gitea/models/db" ) -func getRepositoriesByForkID(e db.Engine, forkID int64) ([]*Repository, error) { +// GetRepositoriesByForkID returns all repositories with given fork ID. +func GetRepositoriesByForkID(ctx context.Context, forkID int64) ([]*Repository, error) { repos := make([]*Repository, 0, 10) - return repos, e. + return repos, db.GetEngine(ctx). Where("fork_id=?", forkID). Find(&repos) } -// GetRepositoriesByForkID returns all repositories with given fork ID. -func GetRepositoriesByForkID(ctx context.Context, forkID int64) ([]*Repository, error) { - return getRepositoriesByForkID(db.GetEngine(ctx), forkID) -} - // GetForkedRepo checks if given user has already forked a repository with given ID. func GetForkedRepo(ownerID, repoID int64) *Repository { repo := new(Repository) |