diff options
Diffstat (limited to 'P2P/Address.hs')
-rw-r--r-- | P2P/Address.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/P2P/Address.hs b/P2P/Address.hs index 19ff82a89..09ffc7973 100644 --- a/P2P/Address.hs +++ b/P2P/Address.hs @@ -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 |