Factor out code for detecting if a module location is the same
repository as currently checked out.