Branch name regex in push rules not working for empty branch creation

Summary

Branch name regex in push rules not working, i am able to push branch with name that doesn't match the regex

Steps to reproduce

  • In a repo, go to settings > repository > push rules > branch name
  • set a static regex
  • i have tried all these
    • testBranch
    • /testBranch/
    • (testBranch)
  • so according to this regex, i must only be able to create a branch named testBranch, every name other than that must be rejected.
  • now go to project and try create a branch named demoBranch or any other name
  • you would be able to create that branch

Example Project

What is the current bug behavior?

  • i am able to create branch having names that doesn't match the branch name regex in push rules

What is the expected correct behavior?

  • i must only be able to create branches having such names that matches the regex

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Edited Oct 11, 2018 by Mark Fletcher
Assignee Loading
Time tracking Loading