summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/fork.go
diff options
context:
space:
mode:
authorKyle Evans <kevans91@users.noreply.github.com>2021-08-28 03:37:14 -0500
committerGitHub <noreply@github.com>2021-08-28 16:37:14 +0800
commitcad70599a65894651d91ad230b57857a443a4d26 (patch)
tree81181d7a44f8dd3f15234ca4ec28b03f1ff4187b /routers/api/v1/repo/fork.go
parent19049413827b130809ffe249900a5c89ef8a90df (diff)
downloadgitea-cad70599a65894651d91ad230b57857a443a4d26.tar.gz
gitea-cad70599a65894651d91ad230b57857a443a4d26.zip
Refactor the fork service slightly to take ForkRepoOptions (#16744)
* Refactor the fork service slightly to take ForkRepoOptions This reduces the number of places we need to change if we want to add other options during fork time. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * Fix integrations and tests after ForkRepository refactor Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * Update OldRepo -> BaseRepo Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * gofmt pass Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r--routers/api/v1/repo/fork.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go
index a3f9aa14f9..b3504faad9 100644
--- a/routers/api/v1/repo/fork.go
+++ b/routers/api/v1/repo/fork.go
@@ -123,7 +123,11 @@ func CreateFork(ctx *context.APIContext) {
forker = org
}
- fork, err := repo_service.ForkRepository(ctx.User, forker, repo, repo.Name, repo.Description)
+ fork, err := repo_service.ForkRepository(ctx.User, forker, models.ForkRepoOptions{
+ BaseRepo: repo,
+ Name: repo.Name,
+ Description: repo.Description,
+ })
if err != nil {
ctx.Error(http.StatusInternalServerError, "ForkRepository", err)
return