stub Remote.P2P
Similar to GCrypt remotes, P2P remotes have an url, so Remote.Git has to separate them out and handle them, passing off to Remote.P2P. This commit was sponsored by Ignacio on Patreon.
This commit is contained in:
parent
a8c868c2e1
commit
b29088b8dc
5 changed files with 99 additions and 2 deletions
|
@ -10,6 +10,7 @@ module P2P.Address where
|
|||
import qualified Annex
|
||||
import Annex.Common
|
||||
import Git
|
||||
import Git.Types
|
||||
import Creds
|
||||
import Utility.AuthToken
|
||||
import Utility.Tor
|
||||
|
@ -54,6 +55,10 @@ instance FormatP2PAddress P2PAddressAuth where
|
|||
authtoken <- toAuthToken (T.pack $ reverse ra)
|
||||
return (P2PAddressAuth addr authtoken)
|
||||
|
||||
repoP2PAddress :: Repo -> Maybe P2PAddress
|
||||
repoP2PAddress (Repo { location = Url url }) = unformatP2PAddress (show url)
|
||||
repoP2PAddress _ = Nothing
|
||||
|
||||
-- | Load known P2P addresses for this repository.
|
||||
loadP2PAddresses :: Annex [P2PAddress]
|
||||
loadP2PAddresses = mapMaybe unformatP2PAddress . maybe [] lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue