never pick special remotes in --fast
even if they have the lowest cost, we cannot use them
This commit is contained in:
parent
c61642ef0c
commit
6cd4c7efcd
1 changed files with 3 additions and 2 deletions
|
@ -56,13 +56,14 @@ syncRemotes rs = do
|
||||||
then nub <$> pickfast
|
then nub <$> pickfast
|
||||||
else wanted
|
else wanted
|
||||||
where
|
where
|
||||||
|
pickfast = (++) <$> listed <*> (fastest <$> available)
|
||||||
wanted
|
wanted
|
||||||
| null rs = filterM hasurl =<< Remote.enabledRemoteList
|
| null rs = available
|
||||||
| otherwise = listed
|
| otherwise = listed
|
||||||
listed = mapM Remote.byName rs
|
listed = mapM Remote.byName rs
|
||||||
|
available = filterM hasurl =<< Remote.enabledRemoteList
|
||||||
hasurl r = not . null <$> geturl r
|
hasurl r = not . null <$> geturl r
|
||||||
geturl r = fromRepo $ Git.Config.get ("remote." ++ Remote.name r ++ ".url") ""
|
geturl r = fromRepo $ Git.Config.get ("remote." ++ Remote.name r ++ ".url") ""
|
||||||
pickfast = (++) <$> listed <*> (fastest <$> Remote.enabledRemoteList)
|
|
||||||
fastest = fromMaybe [] . headMaybe .
|
fastest = fromMaybe [] . headMaybe .
|
||||||
map snd . sort . M.toList . costmap
|
map snd . sort . M.toList . costmap
|
||||||
costmap = M.fromListWith (++) . map costpair
|
costmap = M.fromListWith (++) . map costpair
|
||||||
|
|
Loading…
Reference in a new issue