I'm not sure I see the value in a hook being right here.  There isn't any harm to doing the following for loop, and then immediately jumping into the PreReceiveHook implementation in Gerrit Code Review.

Basically, I don't see what this hook gives us that we can't already do in PreReceiveHook.

Knowing our conversations about the particular feature you are trying to implement in Gerrit, what we really need is to be able to influence the Map<String,Ref> that is used inside of sendAdvertisedRefs.  Altering that collection needs to be different from PreReceiveHook, because its fired so much earlier than the PreReceiveHook.

We also need to expose the Set<ObjectId> that the IndexPack inside of receivePack generated.  That set needs to be visible to the PreReceiveHook.  Because then Gerrit can complain and reject everything flat out if that object set doesn't jive with what you can actually see.