refactor
This commit is contained in:
parent
43bdebbc2d
commit
8f9951369d
3 changed files with 7 additions and 6 deletions
|
@ -29,7 +29,7 @@ module Remote (
|
|||
) where
|
||||
|
||||
import Control.Monad.State (liftIO)
|
||||
import Control.Monad (when, liftM)
|
||||
import Control.Monad (when, liftM, filterM)
|
||||
import Data.List
|
||||
import qualified Data.Map as M
|
||||
import Data.Maybe
|
||||
|
@ -42,6 +42,7 @@ import Trust
|
|||
import LocationLog
|
||||
import Locations
|
||||
import Utility
|
||||
import Config
|
||||
|
||||
import qualified Remote.Git
|
||||
import qualified Remote.S3
|
||||
|
@ -68,7 +69,8 @@ genList = do
|
|||
where
|
||||
process m t = do
|
||||
l <- enumerate t
|
||||
mapM (gen m t) l
|
||||
l' <- filterM remoteNotIgnored l
|
||||
mapM (gen m t) l'
|
||||
gen m t r = do
|
||||
u <- getUUID r
|
||||
generate t r (M.lookup u m)
|
||||
|
|
|
@ -14,7 +14,6 @@ import Control.Exception.Extensible
|
|||
import Control.Monad.State (liftIO)
|
||||
import qualified Data.Map as M
|
||||
import System.Cmd.Utils
|
||||
import Control.Monad (filterM)
|
||||
|
||||
import RemoteClass
|
||||
import Types
|
||||
|
@ -41,7 +40,7 @@ remote = RemoteType {
|
|||
list :: Annex [Git.Repo]
|
||||
list = do
|
||||
g <- Annex.gitRepo
|
||||
filterM remoteNotIgnored $ Git.remotes g
|
||||
return $ Git.remotes g
|
||||
|
||||
gen :: Git.Repo -> Maybe (M.Map String String) -> Annex (Remote Annex)
|
||||
gen repo _ = do
|
||||
|
|
|
@ -16,7 +16,7 @@ import qualified Data.ByteString.Lazy.Char8 as L
|
|||
import qualified Data.Map as M
|
||||
import Data.Maybe
|
||||
import Data.String.Utils
|
||||
import Control.Monad (filterM, when)
|
||||
import Control.Monad (when)
|
||||
import Control.Monad.State (liftIO)
|
||||
import System.Environment
|
||||
|
||||
|
@ -41,7 +41,7 @@ remote = RemoteType {
|
|||
s3List :: Annex [Git.Repo]
|
||||
s3List = do
|
||||
g <- Annex.gitRepo
|
||||
filterM remoteNotIgnored $ findS3Remotes g
|
||||
return $ findS3Remotes g
|
||||
|
||||
{- S3 remotes have a remote.<name>.annex-s3 config setting.
|
||||
- Git.Repo does not normally generate remotes for things that
|
||||
|
|
Loading…
Reference in a new issue