From cad70599a65894651d91ad230b57857a443a4d26 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 28 Aug 2021 03:37:14 -0500 Subject: 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 * Fix integrations and tests after ForkRepository refactor Signed-off-by: Kyle Evans * Update OldRepo -> BaseRepo Signed-off-by: Kyle Evans * gofmt pass Signed-off-by: Kyle Evans --- routers/web/repo/pull.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'routers/web/repo/pull.go') diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index 2fa5ab9186..a41c9eb2b4 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -225,7 +225,11 @@ func ForkPost(ctx *context.Context) { } } - repo, err := repo_service.ForkRepository(ctx.User, ctxUser, forkRepo, form.RepoName, form.Description) + repo, err := repo_service.ForkRepository(ctx.User, ctxUser, models.ForkRepoOptions{ + BaseRepo: forkRepo, + Name: form.RepoName, + Description: form.Description, + }) if err != nil { ctx.Data["Err_RepoName"] = true switch { -- cgit v1.2.3