For example, if the HEAD is excluded:
warning: ref 'refs/heads/master' is excluded by the rev-list options
warning: ref 'HEAD' is excluded by the rev-list options
fatal: Refusing to create empty bundle.
The fatal message always appears last (though that's of course undocumented).
This verifies that all objects from the current clone are in either the dependency bundles or the current bundle. This guarantees that the repo as it has been clone at the time of retrieval can be reconstructed exactly from the bundles.
As a side-effect, if a non-standard Git server were to include objects in a clone pack that are not discoverable from refs, this will fail any attempt to archive such a clone. This could in the future be resolved by adding custom refs for those extra objects.
This also fixes a bug where prior bundles could be included as a dependency even though they contain no relevant data due to their refs (as refs are always listed in the bundle metadata). Instead, dependency detection now operates directly on commit and tag objects, which can only be present in one bundle.