aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private/internal.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-09-16 14:34:54 +0100
committerGitHub <noreply@github.com>2021-09-16 15:34:54 +0200
commit8de44d1995e73ec139ede5626466af1fce8c571a (patch)
tree1d47dbb69c70e2716785e804c39fcf59ba701559 /routers/private/internal.go
parenta959ed99c2966dfc10ac41710eb74b7baf490bcf (diff)
downloadgitea-8de44d1995e73ec139ede5626466af1fce8c571a.tar.gz
gitea-8de44d1995e73ec139ede5626466af1fce8c571a.zip
Clean-up HookPreReceive and restore functionality for pushing non-standard refs (#16705)
* Clean-up HookPreReceive and restore functionality for pushing non-standard refs There was an inadvertent breaking change in #15629 meaning that notes refs and other git extension refs will be automatically rejected. Further following #14295 and #15629 the pre-recieve hook code is untenably long and too complex. This PR refactors the hook code and removes the incorrect forced rejection of non-standard refs. Fix #16688 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/private/internal.go')
-rw-r--r--routers/private/internal.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/private/internal.go b/routers/private/internal.go
index 155e8c036b..183ab5e98a 100644
--- a/routers/private/internal.go
+++ b/routers/private/internal.go
@@ -56,10 +56,10 @@ func Routes() *web.Route {
r.Post("/ssh/authorized_keys", AuthorizedPublicKeyByContent)
r.Post("/ssh/{id}/update/{repoid}", UpdatePublicKeyInRepo)
r.Post("/ssh/log", bind(private.SSHLogOption{}), SSHLog)
- r.Post("/hook/pre-receive/{owner}/{repo}", bind(private.HookOptions{}), HookPreReceive)
+ r.Post("/hook/pre-receive/{owner}/{repo}", RepoAssignment, bind(private.HookOptions{}), HookPreReceive)
r.Post("/hook/post-receive/{owner}/{repo}", bind(private.HookOptions{}), HookPostReceive)
- r.Post("/hook/proc-receive/{owner}/{repo}", bind(private.HookOptions{}), HookProcReceive)
- r.Post("/hook/set-default-branch/{owner}/{repo}/{branch}", SetDefaultBranch)
+ r.Post("/hook/proc-receive/{owner}/{repo}", RepoAssignment, bind(private.HookOptions{}), HookProcReceive)
+ r.Post("/hook/set-default-branch/{owner}/{repo}/{branch}", RepoAssignment, SetDefaultBranch)
r.Get("/serv/none/{keyid}", ServNoCommand)
r.Get("/serv/command/{keyid}/{owner}/{repo}", ServCommand)
r.Post("/manager/shutdown", Shutdown)