summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-07-27 02:23:38 -0700
committerLauris BH <lauris@nix.lv>2017-07-27 12:23:38 +0300
commitfd45a032a7752e4da7e0388eb9661a7c32ff5c85 (patch)
tree94637449649347aec3a42969b15ee74129143251 /routers
parentaff11bc65e09bfe607d574cb60888a54cff75456 (diff)
downloadgitea-fd45a032a7752e4da7e0388eb9661a7c32ff5c85.tar.gz
gitea-fd45a032a7752e4da7e0388eb9661a7c32ff5c85.zip
Fix bare-repo bugs (#2199)
* Fix bare-repo bugs * Integration tests * Unused import
Diffstat (limited to 'routers')
-rw-r--r--routers/routes/routes.go5
1 files changed, 4 insertions, 1 deletions
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))