diff options
author | Unknwon <u@gogs.io> | 2015-08-08 17:24:10 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-08 17:24:10 +0800 |
commit | e3bdfd51ff4a3987c9c14d46d4c145f550b42d01 (patch) | |
tree | cb9629ce61cbc79e99fe9b910e92890e0dea4117 /routers | |
parent | 9db4acc62e2d253c21ce9aed2e21003ff235d5b5 (diff) | |
download | gitea-e3bdfd51ff4a3987c9c14d46d4c145f550b42d01.tar.gz gitea-e3bdfd51ff4a3987c9c14d46d4c145f550b42d01.zip |
better fork permission check
Diffstat (limited to 'routers')
-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 cb5167033c..a4ebb91a39 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -78,6 +78,12 @@ func ForkPost(ctx *middleware.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) { |