From 670ade9a6178c699c04c08595b1cc8fb4c3b0863 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 1 Sep 2015 11:57:02 -0400 Subject: [PATCH] #1206 does not allow fork bare repo --- routers/repo/pull.go | 7 +++++++ templates/repo/header.tmpl | 4 +++- templates/repo/header_old.tmpl | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) 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 diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 74e04d0988..141c5514cf 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -2,13 +2,15 @@