fix lockKey to run callback in original Annex monad, not local remote's

This commit is contained in:
Joey Hess 2015-10-09 13:35:28 -04:00
parent 4c6095b6f5
commit 865dd11dbf
Failed to extract signature
2 changed files with 16 additions and 3 deletions

View file

@ -13,6 +13,7 @@ module Annex (
new,
run,
eval,
makeRunner,
getState,
changeState,
withState,
@ -203,6 +204,13 @@ eval s a = do
mvar <- newMVar s
runReaderT (runAnnex a) mvar
{- Makes a runner action, that allows diving into IO and from inside
- the IO action, running an Annex action. -}
makeRunner :: Annex (Annex a -> IO a)
makeRunner = do
mvar <- ask
return $ \a -> runReaderT (runAnnex a) mvar
getState :: (AnnexState -> v) -> Annex v
getState selector = do
mvar <- ask