If ensureObjectsProvidedVisible is true I think we also need to do something to verify the user can "see" the base objects they have used in the pack file.  I failed to really give you a way to implement that as part of this method.

In theory, given how the send-pack/receive-pack protocol works in Git, the base objects *must* have been marked as UNINTERESTING above during the markUninteresting calls.  Therefore I think we can do this here:

  for (ObjectId id : getBaseObjectIds()) {
    RevObject b = ow.lookupAny(id);
    if (!b.has(RevFlag.UNINTERESTING))
      throw new MissingObjectException(b, b.getType());
  }