summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-31 04:50:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-31 04:50:39 -0400
commitf0957426c586610d16ad9694e002b73324baa29a (patch)
tree2d0d05a82cd6e77e4bb70a26a9f3aa35c9d20a4f /Command/Sync.hs
parent25e4b116c7ab436492a86236f796310d405517a1 (diff)
skip local remotes that are not available (ie, not mounted)
With --fast, unavailable local remotes are filtered out of the fast set. This way, if there are local remotes, --fast always acts only on them, and if none are mounted, acts on nothing. This consistency is better than --fast acting on different remotes depending on what's mounted.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 759df36ea..445a37137 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -57,12 +57,13 @@ syncRemotes rs = do
then nub <$> pickfast
else wanted
where
- pickfast = (++) <$> listed <*> (fastest <$> available)
+ pickfast = (++) <$> listed <*> (good =<< fastest <$> available)
wanted
- | null rs = available
+ | null rs = good =<< available
| otherwise = listed
listed = mapM Remote.byName 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