atomic file retrieval from backends

This commit is contained in:
Joey Hess 2010-10-17 16:39:30 -04:00
parent 8398b9ab4a
commit a020b0c25c
4 changed files with 22 additions and 10 deletions

View file

@ -29,6 +29,8 @@ startup flags = do
shutdown :: Annex ()
shutdown = do
g <- Annex.gitRepo
-- handle pending commits
nocommit <- Annex.flagIsSet NoCommit
needcommit <- Annex.flagIsSet NeedCommit
if (needcommit && not nocommit)
@ -36,6 +38,13 @@ shutdown = do
"git-annex log update", gitStateDir g]
else return ()
-- clean up any files left in the temp directory
let tmp = annexTmpLocation g
exists <- liftIO $ doesDirectoryExist tmp
if (exists)
then liftIO $ removeDirectoryRecursive $ tmp
else return ()
{- configure git to use union merge driver on state files, if it is not
- already -}
gitAttributes :: Git.Repo -> IO ()