diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-14 16:13:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-14 16:13:43 -0400 |
commit | aa2f4bd81049e3bcaad6f5f1334864ce14887527 (patch) | |
tree | c95789d863313ab610a6ebd4514ed2623801dd28 /Annex.hs | |
parent | d4ce0724527fa0155f737b5d3e94e190c27d29dc (diff) |
bug
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -14,9 +14,18 @@ import qualified GitRepo as Git import Types import qualified BackendTypes as Backend --- constructor -new :: Git.Repo -> AnnexState -new g = Backend.AnnexState { Backend.repo = g, Backend.backends = [] } +{- Create and returns an Annex state object for the specified git repo. + -} +new :: Git.Repo -> IO AnnexState +new g = do + let s = Backend.AnnexState { Backend.repo = g, Backend.backends = [] } + (_,s') <- Annex.run s (prep g) + return s' + where + prep g = do + -- read git config and update state + g' <- liftIO $ Git.configRead g + Annex.gitRepoChange g' -- performs an action in the Annex monad run state action = runStateT (action) state |