summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-13 14:51:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-13 14:51:09 -0400
commit77055f5ff82d2712f599ba77e03d5d2cc022ff65 (patch)
treec92c8085eac59d67130e1cb1bb55194e2051463a /Annex.hs
parent771a6b36e1527571b9a38baacbee6e864f44172a (diff)
move some stuff out of IO
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Annex.hs b/Annex.hs
index bd57514ea..e06bd84bc 100644
--- a/Annex.hs
+++ b/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 =