summaryrefslogtreecommitdiff
path: root/Core.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-17 16:39:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-17 16:39:30 -0400
commita020b0c25c4e7c2e14d685eac8c4d3aa0e1fef8a (patch)
treee008a967ab6ea350e97c723924fd8f95ad91d04c /Core.hs
parent8398b9ab4a654f3f6ec570b70229a8a0030e8ab6 (diff)
atomic file retrieval from backends
Diffstat (limited to 'Core.hs')
-rw-r--r--Core.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Core.hs b/Core.hs
index 27411b2e6..302e304e4 100644
--- a/Core.hs
+++ b/Core.hs
@@ -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 ()