diff options
author | Bwko <bouwko@gmail.com> | 2017-07-26 09:17:38 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-07-26 15:17:38 +0800 |
commit | 8f171210b99b2c6cecab45dcf23d69ee84bccc4f (patch) | |
tree | 7b0bf9b72a26d2f04fac0667676252f25661b458 /routers/repo/pull.go | |
parent | 48898e5d0b9ed678b0373b28a5aefa8b5405d37f (diff) | |
download | gitea-8f171210b99b2c6cecab45dcf23d69ee84bccc4f.tar.gz gitea-8f171210b99b2c6cecab45dcf23d69ee84bccc4f.zip |
Revert "Add ability to fork your own repos (#761)" (#2193)
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 b17c26e779..ad4a01ec94 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -111,6 +111,12 @@ func ForkPost(ctx *context.Context, form auth.CreateRepoForm) { return } + repo, has := models.HasForkedRepo(ctxUser.ID, forkRepo.ID) + if has { + ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name) + return + } + // Check ownership of organization. if ctxUser.IsOrganization() { if !ctxUser.IsOwnedBy(ctx.User.ID) { |