diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-12 16:41:54 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-12 16:41:54 -0400 |
commit | 957dffd030816a067fa6ee3c93f63311ad1f009c (patch) | |
tree | 38770fb328269f1ebc45a26fc7a3f3bf88199ae6 /Annex.hs | |
parent | 79a3398d4cb3837d51d4431a2bb29a7a70a8f335 (diff) |
Bugfix: Fix bug in inode cache sentinal check, which broke copying to local repos if the repo being copied from had moved to a different filesystem or otherwise changed all its inodes'
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -31,6 +31,7 @@ module Annex ( getGitConfig, changeGitConfig, changeGitRepo, + withCurrentState, ) where import "mtl" Control.Monad.State.Strict @@ -216,3 +217,13 @@ changeGitRepo r = changeState $ \s -> s { repo = r , gitconfig = extractGitConfig r } + +{- Converts an Annex action into an IO action, that runs with a copy + - of the current Annex state. + - + - Use with caution; the action should not rely on changing the + - state, as it will be thrown away. -} +withCurrentState :: Annex a -> Annex (IO a) +withCurrentState a = do + s <- getState id + return $ eval s a |