Protected Tag catch all prevents deletion of merged branches

Summary

Protected Tag catch all prevents deletion of merged branches

DeleteMergedBranchesService uses Project#protected_for? which checks both ProtectedBranch and ProtectedTag existence

Steps to reproduce

  • Create a new project
  • Create a new branch
  • Add a file
  • Create a Merge Request that won't delete the source branch
  • Merge the MR
  • Verify that a merged branch is listed in the branches index
  • In Project Settings > Repository
  • Create a new rule for Protected Tags using a catch all wildcard * for Masters

Screen_Shot_2017-11-02_at_15.29.38

  • Navigate back to the branches index
  • Attempt to "Delete Merged Branches"

Example Project

https://gitlab.com/issue-reproduce/protected-tags-deletion/branches

What is the current bug behavior?

Merged branch deletion operation is invoked but no branches are deleted in the deferred job

What is the expected correct behavior?

Merged branches should be deleted

Relevant logs and/or screenshots

N/A

Output of checks

reproduced on GitLab.com v10.1.1