Factor out code to convert local "url" into a path.

Previously this code was shared between `local_push` and `local_connect`.