summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CmdLine.hs7
-rw-r--r--Content.hs11
-rw-r--r--Remote/Git.hs3
3 files changed, 13 insertions, 8 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index d10516bb9..ab7236847 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -19,7 +19,7 @@ import Control.Monad (when)
import qualified Annex
import qualified AnnexQueue
import qualified GitRepo as Git
-import qualified Branch
+import Content
import Types
import Command
import BackendList
@@ -103,9 +103,6 @@ startup = do
{- Cleanup actions. -}
shutdown :: Annex Bool
shutdown = do
- AnnexQueue.flush False
- Branch.commit "update"
-
+ saveState
liftIO $ Git.reap
-
return True
diff --git a/Content.hs b/Content.hs
index 45653fc9e..d733ad8b3 100644
--- a/Content.hs
+++ b/Content.hs
@@ -19,7 +19,8 @@ module Content (
removeAnnex,
fromAnnex,
moveBad,
- getKeysPresent
+ getKeysPresent,
+ saveState
) where
import System.IO.Error (try)
@@ -37,6 +38,8 @@ import LocationLog
import UUID
import qualified GitRepo as Git
import qualified Annex
+import qualified AnnexQueue
+import qualified Branch
import Utility
import StatFS
import Types.Key
@@ -263,3 +266,9 @@ getKeysPresent' dir = do
case result of
Right s -> return $ isRegularFile s
Left _ -> return False
+
+{- Things to do to record changes to content. -}
+saveState :: Annex ()
+saveState = do
+ AnnexQueue.flush False
+ Branch.commit "update"
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 5b9d5d3df..c8290c9a7 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -17,7 +17,6 @@ import Types
import Types.Remote
import qualified GitRepo as Git
import qualified Annex
-import qualified AnnexQueue
import Locations
import UUID
import Utility
@@ -147,7 +146,7 @@ copyToRemote r key
Annex.eval a $ do
ok <- Content.getViaTmp key $
rsyncOrCopyFile r keysrc
- AnnexQueue.flush True
+ Content.saveState
return ok
| Git.repoIsSsh r = do
g <- Annex.gitRepo