Open a connection to a remote.
The transport is selected based on the URL; the direction argument is due to a limitation of the git protocol which starts up a specific binary which can only do the one or the other.
GIT_DIRECTION_FETCH if you want to fetch or GIT_DIRECTION_PUSH if you want to push
0 or an error code