Protected branches preview shows too many branches when using a wildcard pattern
### Summary When using an infix wildcard pattern for protected branches, the protected branch preview shows branches that don't seem to be protected For example, when you have the branches `7.3.x` and `7.3.x-patch` in your project, and use the `7.*.x` wildcard to protect your branches * the main page says only one branch is protected (which I assume is the `7.3.x` branch) ![image](/uploads/6453ec8b59d807016ad1e3bd2c89a6ab/image.png){width=900 height=515} * the 'show matching branches' page also includes the `7.3.x-patch` branch ![image](/uploads/ca6a0f8b4885bc661bc8ed51887b68be/image.png){width=900 height=515} ### Steps to reproduce * Have a repository with branches `7.3.x` and `7.3.x-patch` * Open the repository settings and add the `7.*.x` wildcard pattern for protected branches * Notice the difference in the counted 'protected branches' and the list of protected branches when you click through on that count ### Example Project https://gitlab.com/willem.verstraeten/protected-branches-reproduction/-/protected_branches/187188217 ### What is the current *bug* behavior? The list of protected branches does not match the summary count of protected branches ### What is the expected *correct* behavior? The count and the list should match ### Relevant logs and/or screenshots * the main page says only one branch is protected (which I assume is the `7.3.x` branch) ![image](/uploads/6453ec8b59d807016ad1e3bd2c89a6ab/image.png){width=900 height=515} * the 'show matching branches' page also includes the `7.3.x-patch` branch ![image](/uploads/ca6a0f8b4885bc661bc8ed51887b68be/image.png){width=900 height=515} ### Output of checks <!-- If you are reporting a bug on GitLab.com, uncomment below --> This bug happens on GitLab.com as well as on our on-prem instance (version 18.6). #### Results of GitLab environment info ![image](/uploads/839b56cca6be4873cd90380dd8db10b0/image.png){width=410 height=600}
issue