From 9b4142c9e0ae2f6720b0af2012a3bc2b1046670f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 18 Jun 2014 17:23:36 -0400 Subject: Fix bug in annex.queuesize calculation that caused much more queue flushing than necessary. The bug caused the size of the queue to be miscalculted; it was doubled each time an item was added. Commands run after approx 140 items rather than the intended 10240! --- Git/Queue.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Git') diff --git a/Git/Queue.hs b/Git/Queue.hs index 2ec3a2b1e..9b87a18ea 100644 --- a/Git/Queue.hs +++ b/Git/Queue.hs @@ -82,16 +82,16 @@ new lim = Queue 0 (fromMaybe defaultLimit lim) M.empty -} addCommand :: String -> [CommandParam] -> [FilePath] -> Queue -> Repo -> IO Queue addCommand subcommand params files q repo = - updateQueue action different (length newfiles) q repo + updateQueue action different (length files) q repo where key = actionKey action action = CommandAction { getSubcommand = subcommand , getParams = params - , getFiles = newfiles + , getFiles = allfiles } - newfiles = map File files ++ maybe [] getFiles (M.lookup key $ items q) - + allfiles = map File files ++ maybe [] getFiles (M.lookup key $ items q) + different (CommandAction { getSubcommand = s }) = s /= subcommand different _ = True -- cgit v1.2.3