summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-01 11:57:02 -0400
committerUnknwon <u@gogs.io>2015-09-01 11:57:02 -0400
commit670ade9a6178c699c04c08595b1cc8fb4c3b0863 (patch)
tree285c965e16ce0d3c89559aef5e66ea3368b749c6 /routers
parent398569f6f8c9636a7497a250f02e9c6b0a27ea9a (diff)
downloadgitea-670ade9a6178c699c04c08595b1cc8fb4c3b0863.tar.gz
gitea-670ade9a6178c699c04c08595b1cc8fb4c3b0863.zip
#1206 does not allow fork bare repo
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/pull.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index d2aea3d27a..6ccca57c54 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -33,6 +33,13 @@ func getForkRepository(ctx *middleware.Context) *models.Repository {
}
return nil
}
+
+ // Cannot fork bare repo.
+ if forkRepo.IsBare {
+ ctx.Handle(404, "", nil)
+ return nil
+ }
+
ctx.Data["repo_name"] = forkRepo.Name
ctx.Data["desc"] = forkRepo.Description
ctx.Data["IsPrivate"] = forkRepo.IsPrivate