[Version Control] Minor optimizations.

Replaced workaround GroupBy with GroupByRepository.
Removed a double vi.Init call.