We think that the information about the SSH session SshTransport.sock should be stored in the transport as it is currently and should not be moved. Because if it would be stored in the connection instead, it couldn't be shared between different connections. Since the (Jsch)connection needs to open a channel (using sock.openChannel) we need access to SshTransport.sock.

Since the reason for this constructor argument is the access to SshTransport.sock, the argument could be of type SshTransport instead of TransportGitSsh. Would this be better? 

(Of course in the long run SshTransport.sock should not be Jsch specific but this wouldn't change that the connection needs access to the session)