From fd45a032a7752e4da7e0388eb9661a7c32ff5c85 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 27 Jul 2017 02:23:38 -0700 Subject: Fix bare-repo bugs (#2199) * Fix bare-repo bugs * Integration tests * Unused import --- routers/routes/routes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'routers') diff --git a/routers/routes/routes.go b/routers/routes/routes.go index d085a0910e..096daad8e2 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -590,11 +590,14 @@ func RegisterRoutes(m *macaron.Macaron) { }, repo.MustAllowPulls, context.CheckUnit(models.UnitTypePullRequests)) m.Group("", func() { - m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home) m.Get("/raw/*", repo.SingleDownload) m.Get("/commits/*", repo.RefCommits) m.Get("/graph", repo.Graph) m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.Diff) + }, repo.MustBeNotBare, context.RepoRef(), context.CheckUnit(models.UnitTypeCode)) + + m.Group("", func() { + m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home) m.Get("/forks", repo.Forks) }, context.RepoRef(), context.CheckUnit(models.UnitTypeCode)) m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.MustBeNotBare, repo.RawDiff, context.CheckUnit(models.UnitTypeCode)) -- cgit v1.2.3