diff options
-rw-r--r-- | Command/Sync.hs | 4 | ||||
-rw-r--r-- | Remote.hs | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 81b77e5cc..d8eb0fc39 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -54,12 +54,12 @@ syncRemotes rs = do else wanted where wanted - | null rs = filterM hasurl =<< Remote.remoteList + | null rs = filterM hasurl =<< Remote.enabledRemoteList | otherwise = listed listed = mapM Remote.byName rs hasurl r = not . null <$> geturl r geturl r = fromRepo $ Git.Config.get ("remote." ++ Remote.name r ++ ".url") "" - pickfast = (++) <$> listed <*> (fastest <$> Remote.remoteList) + pickfast = (++) <$> listed <*> (fastest <$> Remote.enabledRemoteList) fastest = fromMaybe [] . headMaybe . map snd . sort . M.toList . costmap costmap = M.fromListWith (++) . map costpair @@ -17,6 +17,7 @@ module Remote ( remoteTypes, remoteList, + enabledRemoteList, remoteMap, byName, prettyPrintUUIDs, @@ -85,6 +86,10 @@ remoteList = do u <- getRepoUUID r generate t r u (M.lookup u m) +{- All remotes that are not ignored. -} +enabledRemoteList :: Annex [Remote Annex] +enabledRemoteList = filterM (repoNotIgnored . repo) =<< remoteList + {- Map of UUIDs of Remotes and their names. -} remoteMap :: Annex (M.Map UUID String) remoteMap = M.fromList . map (\r -> (uuid r, name r)) <$> remoteList @@ -196,7 +201,7 @@ keyPossibilities' withtrusted key = do let validtrusteduuids = validuuids `intersect` trusted -- remotes that match uuids that have the key - allremotes <- filterM (repoNotIgnored . repo) =<< remoteList + allremotes <- enabledRemoteList let validremotes = remotesWithUUID allremotes validuuids return (sort validremotes, validtrusteduuids) |