summaryrefslogtreecommitdiff
path: root/Core.hs
diff options
context:
space:
mode:
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 ()