diff options
Diffstat (limited to 'Annex/SpecialRemote.hs')
-rw-r--r-- | Annex/SpecialRemote.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Annex/SpecialRemote.hs b/Annex/SpecialRemote.hs index 44bc666ce..3892eea2f 100644 --- a/Annex/SpecialRemote.hs +++ b/Annex/SpecialRemote.hs @@ -42,10 +42,14 @@ findByName n = filter (matching . snd) . M.toList | n' == n -> True | otherwise -> False -remoteNames :: Annex [RemoteName] -remoteNames = do +specialRemoteMap :: Annex (M.Map UUID RemoteName) +specialRemoteMap = do m <- Logs.Remote.readRemoteLog - return $ mapMaybe (M.lookup nameKey . snd) $ M.toList m + return $ M.fromList $ mapMaybe go (M.toList m) + where + go (u, c) = case M.lookup nameKey c of + Nothing -> Nothing + Just n -> Just (u, n) {- find the specified remote type -} findType :: RemoteConfig -> Either String RemoteType |