gitea/cmd
James E. Blair 488d34691a Ignore non-standard refs in git push (#6758)
When replicating to gitea from a remote system which makes use of
git refs to store extra data (for example, gerrit), pushing a lot
of refs to gitea can cause problems due to the extra processing
that the pre and post receive hooks perform.  But it's still
useful for gitea to be able to serve those refs.  This change
skips unecessary processing of refs other than branches or tags.

We don't need to check any ref that isn't a branch for branch
protection (protection will never be enabled).  So in the
pre-receive hook, we wrap that check in a test for whether the
ref is a branch.

We also don't need to add information to the activity stream about
pushes to non-standard refs, so we skip that step in the
post-receive hook for refs which are not branches or tags.

For some concrete examples, gerrit maintains a ref for every
patchset of every change in the form refs/changes/XX/YYYY/Z.
Many systems use refs/notes to store additonal data about commits.
This change allows these and other schemes to be used without
affecting gitea.
2019-05-14 10:40:27 -04:00
..
admin.go Generate access token in admin cli (#6847) 2019-05-04 23:03:09 +01:00
cert.go General refactor of the cmd package (#3328) 2018-01-12 23:16:49 +01:00
cmd.go Disallow empty titles (#5785) 2019-01-21 13:45:32 +02:00
dump.go Change verbose flag in dump command to avoid colliding with global version flag (#6822) 2019-05-01 21:36:09 +01:00
generate.go Rename LFS_JWT_SECRET to include OAUTH2 as well (#6826) 2019-05-01 22:32:06 -04:00
hook.go Ignore non-standard refs in git push (#6758) 2019-05-14 10:40:27 -04:00
keys.go Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00
migrate.go Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00
serv.go Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00
web_graceful.go Better logging (#6038) (#6095) 2019-04-02 08:48:31 +01:00
web_windows.go fix windows build broken by #416 2016-12-31 17:16:02 +08:00
web.go Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631) 2019-04-29 14:08:21 -04:00