diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-29 23:10:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-29 23:10:18 -0400 |
commit | 652f844e2348165062868cb197ee725d42198f03 (patch) | |
tree | 2d6a26a3659e54428fdf893bc9919ffb0b6de5de /Annex/Queue.hs | |
parent | 69650c5989432cd83067614421c6bc3ef0cccab7 (diff) |
type based git config handling
Now there's a Config type, that's extracted from the git config at startup.
Note that laziness means that individual config values are only looked up
and parsed on demand, and so we get implicit memoization for all of them.
So this is not only prettier and more type safe, it optimises several
places that didn't have explicit memoization before. As well as getting rid
of the ugly explicit memoization code.
Not yet done for annex.<remote>.* configuration settings.
Diffstat (limited to 'Annex/Queue.hs')
-rw-r--r-- | Annex/Queue.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Annex/Queue.hs b/Annex/Queue.hs index 64cc92897..0f8c38ab9 100644 --- a/Annex/Queue.hs +++ b/Annex/Queue.hs @@ -17,7 +17,6 @@ import Common.Annex import Annex hiding (new) import qualified Git.Queue import qualified Git.UpdateIndex -import Config {- Adds a git command to the queue. -} addCommand :: String -> [CommandParam] -> [FilePath] -> Annex () @@ -55,11 +54,9 @@ get = maybe new return =<< getState repoqueue new :: Annex Git.Queue.Queue new = do - q <- Git.Queue.new <$> queuesize + q <- Git.Queue.new . annexQueueSize <$> getConfig store q return q - where - queuesize = readish <$> getConfig (annexConfig "queuesize") "" store :: Git.Queue.Queue -> Annex () store q = changeState $ \s -> s { repoqueue = Just q } |