aboutsummaryrefslogtreecommitdiff
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-25 18:02:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-25 18:02:49 -0400
commitc3fbe07d7ad03944d0967ebfa2b8f65cbc2ad5dc (patch)
treef5c1d22fdc51b597cb291bfe689e4514b0e5610a /CmdLine.hs
parenta3c9d06a265b2d6d3003af805b8345e4ddd3d87c (diff)
do a cleanup commit after moving data from or to a git remote
Added Annex.cleanup, which is a general purpose interface for adding actions to run at the end. Remotes with the old git-annex-shell will commit every time, and have no commit command, so hide stderr when running the commit command.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index fbc1eaeca..05f7bfe2e 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -12,6 +12,7 @@ module CmdLine (
) where
import qualified Control.Exception as E
+import qualified Data.Map as M
import Control.Exception (throw)
import System.Console.GetOpt
@@ -95,6 +96,7 @@ startup = return True
shutdown :: Bool -> Annex Bool
shutdown oneshot = do
saveState oneshot
+ sequence_ =<< M.elems <$> Annex.getState Annex.cleanup
liftIO Git.Command.reap -- zombies from long-running git processes
sshCleanup -- ssh connection caching
return True