diff options
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/CatFile.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Annex/CatFile.hs b/Annex/CatFile.hs index 2f8c43079..8b4d746e1 100644 --- a/Annex/CatFile.hs +++ b/Annex/CatFile.hs @@ -12,6 +12,7 @@ module Annex.CatFile ( catTree, catObjectDetails, catFileHandle, + catFileStop, catKey, catKeyFile, catKeyFileHEAD, @@ -71,6 +72,14 @@ catFileHandle = do Annex.changeState $ \s -> s { Annex.catfilehandles = m' } return h +{- Stops all running cat-files. Should only be run when it's known that + - nothing is using the handles, eg at shutdown. -} +catFileStop :: Annex () +catFileStop = do + m <- Annex.withState $ \s -> + (s { Annex.catfilehandles = M.empty }, Annex.catfilehandles s) + liftIO $ mapM_ Git.CatFile.catFileStop (M.elems m) + {- From the Sha or Ref of a symlink back to the key. - - Requires a mode witness, to guarantee that the file is a symlink. |