[Index state tracking] Handle empty repositories

Follow-up from !195961 (comment 2611360464)

We need to handle the case when a repository has no documents inserted after indexing, and therefore no embeddings to search over.

Edited by 🤖 GitLab Bot 🤖