40-character hexadecimal branch name blocking prevents branch deletion
Example on Stack Overflow: https://stackoverflow.com/questions/67488117/can-not-remove-stale-branches-from-gitlab
We added validation in 28439ca4 to block 40 character hex branch names to solve a vulnerability caused by conflicts between branches named that way and other git refs, like commits. This has to stay in place to prevent branches being created with names like that, but currently it also seems to prevent the deletion of old branches that already have 40 character hex names, as it's implemented as a check on push (which the SO example is using for the deletion). Apparently this is also preventing deletions on the GUI, but I haven't checked that myself yet.
We should modify the check to not apply it on deletion, if possible, or otherwise at least ensure that the branches can be deleted via the GUI as a workaround for legacy branches.
Related #337943 (closed)
/cc @sean_carroll, @a.conrad