summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-31 03:14:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-31 03:14:05 -0400
commit6cd4c7efcdea9a8897aa6b9e2b30e7e3426574bc (patch)
tree65a135235217faa9f7b7627f5296b29ac91276a5 /Command
parentc61642ef0c0203e2e4b698fc7efd6078521a28d0 (diff)
never pick special remotes in --fast
even if they have the lowest cost, we cannot use them
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index cd8ac389d..f3a83517c 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -56,13 +56,14 @@ syncRemotes rs = do
then nub <$> pickfast
else wanted
where
+ pickfast = (++) <$> listed <*> (fastest <$> available)
wanted
- | null rs = filterM hasurl =<< Remote.enabledRemoteList
+ | null rs = available
| otherwise = listed
listed = mapM Remote.byName rs
+ available = filterM hasurl =<< Remote.enabledRemoteList
hasurl r = not . null <$> geturl r
geturl r = fromRepo $ Git.Config.get ("remote." ++ Remote.name r ++ ".url") ""
- pickfast = (++) <$> listed <*> (fastest <$> Remote.enabledRemoteList)
fastest = fromMaybe [] . headMaybe .
map snd . sort . M.toList . costmap
costmap = M.fromListWith (++) . map costpair