Add #getPath to mirror #getHash.

Rather than pass a "force" option to #getFragment, just
extract to a separate method.
Merge pull request #3106 from braddunbar/force-push

Add #getPath to mirror #getHash.