Refactor and better test Repository.path

Refactor method `Repository.path` by trimming down the amount of underlying
code. Better test the method: only one of the two paths was being tested.
This line is 81 chars long.