move some stuff out of IO
This commit is contained in:
parent
771a6b36e1
commit
77055f5ff8
2 changed files with 22 additions and 21 deletions
11
Annex.hs
11
Annex.hs
|
@ -9,7 +9,7 @@ module Annex (
|
|||
annexWantFile,
|
||||
annexDropFile,
|
||||
annexPushRepo,
|
||||
repoCost,
|
||||
annexRemotes,
|
||||
annexPullRepo
|
||||
) where
|
||||
|
||||
|
@ -31,8 +31,9 @@ import Types
|
|||
startAnnex :: IO State
|
||||
startAnnex = do
|
||||
r <- gitRepoFromCwd
|
||||
r' <- prepUUID r
|
||||
gitSetup r'
|
||||
r' <- gitConfigRead r
|
||||
r'' <- prepUUID r'
|
||||
gitSetup r''
|
||||
|
||||
return State {
|
||||
repo = r',
|
||||
|
@ -168,6 +169,10 @@ logStatus state key status = do
|
|||
inAnnex :: State -> Backend -> Key -> IO Bool
|
||||
inAnnex state backend key = doesFileExist $ annexLocation state backend key
|
||||
|
||||
{- Ordered list of remotes for the annex. -}
|
||||
annexRemotes :: State -> [GitRepo]
|
||||
annexRemotes state = reposByCost state $ gitConfigRemotes (repo state)
|
||||
|
||||
{- Orders a list of git repos by cost. -}
|
||||
reposByCost :: State -> [GitRepo] -> [GitRepo]
|
||||
reposByCost state l =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue