improve git location display for issue #867

This request also includes a test for the change.