sync: When some remotes to sync with are specified, and --fast is too, pick the lowest cost of the specified remotes

Do not sync with a faster remote that was not specified.

That old behavior was only documented in the changelog, and was certianly
surprising. It also meant adding --fast made it slower..
This commit is contained in:
Joey Hess 2020-04-23 16:08:45 -04:00
parent 3252c4ccca
commit c05c4e549e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 9 additions and 3 deletions

View file

@ -291,10 +291,8 @@ syncRemotes ps = do
syncRemotes' :: [String] -> [Remote] -> Annex [Remote]
syncRemotes' ps available =
ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted )
ifM (Annex.getState Annex.fast) ( fastest <$> wanted , wanted )
where
pickfast = (++) <$> listed <*> (filterM good (fastest available))
wanted
| null ps = filterM good (concat $ Remote.byCost available)
| otherwise = listed