refactor p2p remote action code

Make a Remote.Helper.P2P using code that was in Remote.P2P, converted to
use generic protocol runner actions.

This will allow it to be reused in Remote.Git.

This commit was sponsored by mo on Patreon.
This commit is contained in:
Joey Hess 2018-03-08 16:11:00 -04:00
parent c036a380b2
commit 16af259209
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 83 additions and 55 deletions

View file

@ -758,8 +758,8 @@ mkDeferredUUIDCheck r u gc
-- Runs a P2P Proto action on a remote when it supports that,
-- otherwise the fallback action.
runSsh :: Remote -> Ssh.P2PSshConnectionPool -> P2P.Proto a -> Annex a -> Annex a
runSsh r connpool proto fallback =
runSsh :: Remote -> Ssh.P2PSshConnectionPool -> Annex a -> P2P.Proto a -> Annex a
runSsh r connpool fallback proto =
Ssh.getP2PSshConnection r connpool >>= maybe fallback go
where
go c = do