aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-04-10 01:26:08 +0100
committerGitHub <noreply@github.com>2021-04-09 20:26:08 -0400
commit136a20926c921650e83b75cf43d38b654cf3173f (patch)
tree9bf12e7c90d316a9010b3fa8ae0020f765a5f15a /routers
parentd0eeba9ff93f17b22e6e9c8a33a351937015fdad (diff)
downloadgitea-136a20926c921650e83b75cf43d38b654cf3173f.tar.gz
gitea-136a20926c921650e83b75cf43d38b654cf3173f.zip
Turn RepoRef and RepoAssignment back into func(*Context) (#15372)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers')
-rw-r--r--routers/routes/web.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/routers/routes/web.go b/routers/routes/web.go
index 7081b30e54..4815680c99 100644
--- a/routers/routes/web.go
+++ b/routers/routes/web.go
@@ -691,7 +691,7 @@ func RegisterRoutes(m *web.Route) {
}, reqSignIn)
// ***** Release Attachment Download without Signin
- m.Get("/{username}/{reponame}/releases/download/{vTag}/{fileName}", ignSignIn, context.RepoAssignment(), repo.MustBeNotEmpty, repo.RedirectDownload)
+ m.Get("/{username}/{reponame}/releases/download/{vTag}/{fileName}", ignSignIn, context.RepoAssignment, repo.MustBeNotEmpty, repo.RedirectDownload)
m.Group("/{username}/{reponame}", func() {
m.Group("/settings", func() {
@@ -771,9 +771,9 @@ func RegisterRoutes(m *web.Route) {
ctx.Data["PageIsSettings"] = true
ctx.Data["LFSStartServer"] = setting.LFS.StartServer
})
- }, reqSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoAdmin, context.RepoRef())
+ }, reqSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoAdmin, context.RepoRef())
- m.Post("/{username}/{reponame}/action/{action}", reqSignIn, context.RepoAssignment(), context.UnitTypes(), repo.Action)
+ m.Post("/{username}/{reponame}/action/{action}", reqSignIn, context.RepoAssignment, context.UnitTypes(), repo.Action)
// Grouping for those endpoints not requiring authentication
m.Group("/{username}/{reponame}", func() {
@@ -783,7 +783,7 @@ func RegisterRoutes(m *web.Route) {
m.Combo("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists).
Get(ignSignIn, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.CompareDiff).
Post(reqSignIn, context.RepoMustNotBeArchived(), reqRepoPullsReader, repo.MustAllowPulls, bindIgnErr(forms.CreateIssueForm{}), repo.SetWhitespaceBehavior, repo.CompareAndPullRequestPost)
- }, context.RepoAssignment(), context.UnitTypes())
+ }, context.RepoAssignment, context.UnitTypes())
// Grouping for those endpoints that do require authentication
m.Group("/{username}/{reponame}", func() {
@@ -890,7 +890,7 @@ func RegisterRoutes(m *web.Route) {
m.Post("/restore", repo.RestoreBranchPost)
}, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty)
- }, reqSignIn, context.RepoAssignment(), context.UnitTypes())
+ }, reqSignIn, context.RepoAssignment, context.UnitTypes())
// Releases
m.Group("/{username}/{reponame}", func() {
@@ -928,11 +928,11 @@ func RegisterRoutes(m *web.Route) {
}
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
})
- }, ignSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoReleaseReader)
+ }, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader)
m.Group("/{username}/{reponame}", func() {
m.Post("/topics", repo.TopicsPost)
- }, context.RepoAssignment(), context.RepoMustNotBeArchived(), reqRepoAdmin)
+ }, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin)
m.Group("/{username}/{reponame}", func() {
m.Group("", func() {
@@ -1080,17 +1080,17 @@ func RegisterRoutes(m *web.Route) {
}, context.RepoRef(), reqRepoCodeReader)
m.Get("/commit/{sha:([a-f0-9]{7,40})}.{ext:patch|diff}",
repo.MustBeNotEmpty, reqRepoCodeReader, repo.RawDiff)
- }, ignSignIn, context.RepoAssignment(), context.UnitTypes())
+ }, ignSignIn, context.RepoAssignment, context.UnitTypes())
m.Group("/{username}/{reponame}", func() {
m.Get("/stars", repo.Stars)
m.Get("/watchers", repo.Watchers)
m.Get("/search", reqRepoCodeReader, repo.Search)
- }, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes())
+ }, ignSignIn, context.RepoAssignment, context.RepoRef(), context.UnitTypes())
m.Group("/{username}", func() {
m.Group("/{reponame}", func() {
m.Get("", repo.SetEditorconfigIfExists, repo.Home)
- }, goGet, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes())
+ }, goGet, ignSignIn, context.RepoAssignment, context.RepoRef(), context.UnitTypes())
m.Group("/{reponame}", func() {
m.Group("/info/lfs", func() {