Add an extra check and return an empty dict if no repo is given. This is needed because `Tag.repository << [rid for rid in repository_ids]` will fail on MySQL if the list is empty.