Add RPC to support bulk deletes for branches
Problem
Reported in issue: 'Delete merged branches' invokes server hooks p... (gitlab#420795).
Rails uses UserDeleteBranch
RPC in cycle when we delete multiple branches.
That leads to performance problems, for N branches we will have N Gitaly calls.
Also, we invoke server hooks N times instead of doing it only once.
Proposal
Introduce an RPC to support bulk deletes for branches. Potentially, it can be applied to tags too.
If we want to go that way I would argue that we should generalize the interface to a
UserUpdateReferences
RPC with a similiar design as in our recently-introducedUpdateReferences
RPC. Like this we could replaceUserCreateBranch
,UserDeleteBranch
andUserUpdateBranch
with a single RPC.