Skip to content

Commit 4c3788e

Browse files
committed
Fix bare-repo bugs
1 parent 5f37944 commit 4c3788e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/routes/routes.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,14 @@ func RegisterRoutes(m *macaron.Macaron) {
590590
}, repo.MustAllowPulls, context.CheckUnit(models.UnitTypePullRequests))
591591

592592
m.Group("", func() {
593-
m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home)
594593
m.Get("/raw/*", repo.SingleDownload)
595594
m.Get("/commits/*", repo.RefCommits)
596595
m.Get("/graph", repo.Graph)
597596
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.Diff)
597+
}, repo.MustBeNotBare, context.RepoRef(), context.CheckUnit(models.UnitTypeCode))
598+
599+
m.Group("", func() {
600+
m.Get("/src/*", repo.SetEditorconfigIfExists, repo.Home)
598601
m.Get("/forks", repo.Forks)
599602
}, context.RepoRef(), context.CheckUnit(models.UnitTypeCode))
600603
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.MustBeNotBare, repo.RawDiff, context.CheckUnit(models.UnitTypeCode))

0 commit comments

Comments
 (0)