-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle more pathological branch and tag names #11843
Handle more pathological branch and tag names #11843
Conversation
Signed-off-by: Andrew Thornton <[email protected]>
Integration tests failing |
Yet again we are bitten by the problem that half the integrations tests don't use repositories properly. |
Signed-off-by: Andrew Thornton <[email protected]>
OK so there was a real issue - in addition to the test being broken - I had missed that we removed the deleted branch reference from the table which of course we no longer have to do as the push does that for us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
escaping :D
ping LG-TM |
@zeripath please send backport :) |
Backport go-gitea#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 <[email protected]>
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 <[email protected]> Co-authored-by: techknowlogick <[email protected]>
* Handle more pathological branch and tag names Signed-off-by: Andrew Thornton <[email protected]> * Fix failing test Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
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 cangit 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 [email protected]