summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index f7ebba6f5..51b6d6f63 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -59,14 +59,14 @@ syncRemotes rs = do
where
pickfast = (++) <$> listed <*> (good =<< fastest <$> available)
wanted
- | null rs = good =<< available
+ | null rs = good =<< concat . byspeed <$> available
| otherwise = listed
listed = catMaybes <$> mapM (Remote.byName . Just) rs
available = filter nonspecial <$> Remote.enabledRemoteList
good = filterM $ Remote.Git.repoAvail . Types.Remote.repo
nonspecial r = Types.Remote.remotetype r == Remote.Git.remote
- fastest = fromMaybe [] . headMaybe .
- map snd . sort . M.toList . costmap
+ fastest = fromMaybe [] . headMaybe . byspeed
+ byspeed = map snd . sort . M.toList . costmap
costmap = M.fromListWith (++) . map costpair
costpair r = (Types.Remote.cost r, [r])