diff options
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r-- | routers/repo/pull.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 067e3c2a..f9b8866e 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -118,6 +118,12 @@ func ForkPost(ctx *context.Context, form auth.CreateRepoForm) { } } + // Cannot fork to same owner + if ctxUser.ID == forkRepo.OwnerID { + ctx.RenderWithErr(ctx.Tr("repo.settings.cannot_fork_to_same_owner"), FORK, &form) + return + } + repo, err := models.ForkRepository(ctxUser, forkRepo, form.RepoName, form.Description) if err != nil { ctx.Data["Err_RepoName"] = true |