summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/Sync.hs7
-rw-r--r--Remote.hs1
-rw-r--r--Remote/List.hs4
3 files changed, 8 insertions, 4 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 023b1b84a..986dd417b 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -66,15 +66,14 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted )
| otherwise = listed
listed = do
l <- catMaybes <$> mapM (Remote.byName . Just) rs
- let s = filter special l
+ let s = filter Remote.specialRemote l
unless (null s) $
error $ "cannot sync special remotes: " ++
unwords (map Types.Remote.name s)
return l
- available = filter nonspecial <$> Remote.enabledRemoteList
+ available = filter (not . Remote.specialRemote)
+ <$> Remote.enabledRemoteList
good = filterM $ Remote.Git.repoAvail . Types.Remote.repo
- nonspecial r = Types.Remote.remotetype r == Remote.Git.remote
- special = not . nonspecial
fastest = fromMaybe [] . headMaybe . byspeed
byspeed = map snd . sort . M.toList . costmap
costmap = M.fromListWith (++) . map costpair
diff --git a/Remote.hs b/Remote.hs
index ac9da0536..ae5a231ad 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -20,6 +20,7 @@ module Remote (
remoteTypes,
remoteList,
enabledRemoteList,
+ specialRemote,
remoteMap,
uuidDescriptions,
byName,
diff --git a/Remote/List.hs b/Remote/List.hs
index 3f3792744..234f310a5 100644
--- a/Remote/List.hs
+++ b/Remote/List.hs
@@ -90,3 +90,7 @@ updateRemote remote = do
{- All remotes that are not ignored. -}
enabledRemoteList :: Annex [Remote]
enabledRemoteList = filterM (repoNotIgnored . repo) =<< remoteList
+
+{- Checks if a remote is a special remote -}
+specialRemote :: Remote -> Bool
+specialRemote r = remotetype r /= Remote.Git.remote