Short answer: if you mean to actually allow some of the refs to be updated, no. You can however already provide multiple veto messages if you want to provide details about each of the problematic refs. Just create a RepositoryHookResult.Builder and call
veto on it multiple times.
More detailed explaination:
Since we only integrate with git’s
post-receive hooks, that’s not an option. The git
pre-receive hook only allow you to either accept or reject all refs.
To be able to reject only some refs, we’d have to integrate with git’s
update hook, which would mean a separate callback from git into Bitbucket Server for each ref that’s updated. That has some implications in terms of performance: many hooks need to retrieve some commit or diff data. This can more efficiently be retrieved (in less git calls) when done for all refs in batch. Per-ref callbacks would result in more overhead in getting information about the proposed change. Add to this the overhead in the git -> Bitbucket Server integration itself. The cost would add up and the system would feel sluggish when pushing multiple refs.