Improve the display of git locations for issue #867.
Add a test and clean up patch.
Simplify the patch further.
Also display the full ref if an abbreviated ref was given.
Merge pull request #869 from cjerdonek/issue-867-git-location-display

improve git location display for issue #867