<name> must match the exact repository's name.
Eliminate duplication for _get_remaining_item_count function