]> source.dussan.org Git - gitea.git/commit
Handle more pathological branch and tag names (#11843) (#11863)
authorzeripath <art27@cantab.net>
Fri, 12 Jun 2020 18:01:44 +0000 (19:01 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Jun 2020 18:01:44 +0000 (14:01 -0400)
commit320031fce693ffe8869da952f3f872b46d3d6550
tree577a6f0d379ccdc933f6955ff5b064e42a38c858
parentef2f18964e86634383e78b7960781dce950abe59
Handle more pathological branch and tag names (#11843) (#11863)

Backport #11843

It's possible to push quite pathological appearing branch names to gitea
using git push gitea reasonable-branch:refs/heads/-- at which point
large parts of the UI will break. Similarly you can git push origin
reasonable-tag:refs/tags/-- which wil return an error.

This PR fixes the problems these cause. It also changes the code from
creating branches to pushing to ensure that branch restoration has to
pass hooks.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
integrations/branches_test.go
modules/git/repo_commit.go
modules/repository/branch.go
routers/repo/branch.go
routers/repo/compare.go
routers/repo/pull.go
services/pull/temp_repo.go