extend Git.Queue to be able to queue more than simple git commands

While I was in there, I noticed and fixed a bug in the queue size
calculations. It was never encountered only because Queue.add was
only ever run with 1 file in the list.
This commit is contained in:
Joey Hess 2012-06-07 15:19:44 -04:00
parent 727158ff55
commit 0a11b35d89
8 changed files with 94 additions and 43 deletions

View file

@ -6,7 +6,7 @@
-}
module Annex.Queue (
add,
addCommand,
flush,
flushWhenFull
) where
@ -17,10 +17,10 @@ import qualified Git.Queue
import Config
{- Adds a git command to the queue. -}
add :: String -> [CommandParam] -> [FilePath] -> Annex ()
add command params files = do
addCommand :: String -> [CommandParam] -> [FilePath] -> Annex ()
addCommand command params files = do
q <- get
store =<< inRepo (Git.Queue.add q command params files)
store =<< inRepo (Git.Queue.addCommand command params files q)
{- Runs the queue if it is full. Should be called periodically. -}
flushWhenFull :: Annex ()