summaryrefslogtreecommitdiff
path: root/Remote/List.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-22 13:48:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-22 14:30:43 -0400
commit4ec9244f1af85b95d014103d93de913026b20fe3 (patch)
treec2ca5dbdc4817f1078b76cd445a4fa69531e905c /Remote/List.hs
parente4592649d68535ad45fe37449a90427e84734359 (diff)
add a path field to remotes
Also broke out some helper functions around constructing remotes, to be used later.
Diffstat (limited to 'Remote/List.hs')
-rw-r--r--Remote/List.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Remote/List.hs b/Remote/List.hs
index 14a1771b4..4127cf24b 100644
--- a/Remote/List.hs
+++ b/Remote/List.hs
@@ -2,7 +2,7 @@
{- git-annex remote list
-
- - Copyright 2011 Joey Hess <joey@kitenet.net>
+ - Copyright 2011,2012 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -18,6 +18,7 @@ import Types.Remote
import Annex.UUID
import Config
import Remote.Helper.Hooks
+import qualified Git
import qualified Remote.Git
#ifdef WITH_S3
@@ -55,10 +56,13 @@ remoteList = do
return rs'
else return rs
where
- process m t = enumerate t >>= mapM (gen m t)
- gen m t r = do
- u <- getRepoUUID r
- addHooks =<< generate t r u (M.lookup u m)
+ process m t = enumerate t >>= mapM (remoteGen m t)
+
+{- Generates a Remote. -}
+remoteGen :: (M.Map UUID RemoteConfig) -> RemoteType -> Git.Repo -> Annex Remote
+remoteGen m t r = do
+ u <- getRepoUUID r
+ addHooks =<< generate t r u (M.lookup u m)
{- All remotes that are not ignored. -}
enabledRemoteList :: Annex [Remote]