Fix bare-repo bugs (#2199)
* Fix bare-repo bugs * Integration tests * Unused import
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user