summaryrefslogtreecommitdiff
path: root/Commands.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-26 16:15:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-26 16:15:29 -0400
commit24ee4439d4783cde7102f4ffd857c521367ce16f (patch)
treee675a22a20a14590e0be153a48c7facac5cf8357 /Commands.hs
parentef26076a5a3df9b8740883e3f7b3b68585b47ad5 (diff)
use git command queue
Diffstat (limited to 'Commands.hs')
-rw-r--r--Commands.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Commands.hs b/Commands.hs
index da4d840ae..6018ed822 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -216,7 +216,7 @@ addCleanup file key = do
liftIO $ renameFile file dest
link <- calcGitLink file key
liftIO $ createSymbolicLink link file
- liftIO $ Git.run g ["add", file]
+ Annex.queue "add" [] file
return True
{- The unannex subcommand undoes an add. -}
@@ -340,11 +340,10 @@ fixPerform file link = do
liftIO $ createDirectoryIfMissing True (parentDir file)
liftIO $ removeFile file
liftIO $ createSymbolicLink link file
- g <- Annex.gitRepo
- liftIO $ Git.run g ["add", file]
- return $ Just $ fixCleanup
-fixCleanup :: Annex Bool
-fixCleanup = do
+ return $ Just $ fixCleanup file
+fixCleanup :: FilePath -> Annex Bool
+fixCleanup file = do
+ Annex.queue "add" [] file
return True
{- Stores description for the repository. -}
@@ -391,8 +390,7 @@ fromKeyPerform file key = do
return $ Just $ fromKeyCleanup file
fromKeyCleanup :: FilePath -> Annex Bool
fromKeyCleanup file = do
- g <- Annex.gitRepo
- liftIO $ Git.run g ["add", file]
+ Annex.queue "add" [] file
return True
{- Move a file either --to or --from a repository.
@@ -453,7 +451,8 @@ moveToCleanup remote key tmpfile = do
-- Record that the key is present on the remote.
g <- Annex.gitRepo
remoteuuid <- getUUID remote
- liftIO $ logChange g key remoteuuid ValuePresent
+ log <- liftIO $ logChange g key remoteuuid ValuePresent
+ Annex.queue "add" [] log
-- Cleanup on the local side is the same as done for the
-- drop subcommand.
dropCleanup key
@@ -492,7 +491,8 @@ moveFromCleanup remote key = do
-- Record locally that the key is not on the remote.
remoteuuid <- getUUID remote
g <- Annex.gitRepo
- liftIO $ logChange g key remoteuuid ValueMissing
+ log <- liftIO $ logChange g key remoteuuid ValueMissing
+ Annex.queue "add" [] log
return True
-- helpers