repository: Make the is_empty check more explicit