summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-28 00:33:19 +1100
committerGravatar Joey Hess <joey@kitenet.net>2013-01-28 00:33:19 +1100
commit7964491f1b5f7a4e2000fd362dea00068f843454 (patch)
treeeb760f55823d5f545acd3b793aef75e28f00753d
parent38dcc9c2cc8302a127e59e3d7d1d07e2d93064f4 (diff)
add another setting to GitConfig
-rw-r--r--Annex/Content.hs2
-rw-r--r--Types/GitConfig.hs5
2 files changed, 5 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index ed234511e..feb1d25e6 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -412,7 +412,7 @@ saveState nocommit = doSideAction $ do
{- Downloads content from any of a list of urls. -}
downloadUrl :: [Url.URLString] -> FilePath -> Annex Bool
downloadUrl urls file = do
- o <- map Param . words <$> getConfig (annexConfig "web-options") ""
+ o <- map Param . annexWebOptions <$> Annex.getGitConfig
headers <- getHttpHeaders
liftIO $ anyM (\u -> Url.download u headers o file) urls
diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs
index 30214bc29..86bfd39b6 100644
--- a/Types/GitConfig.hs
+++ b/Types/GitConfig.hs
@@ -34,6 +34,7 @@ data GitConfig = GitConfig
, annexHttpHeaders :: [String]
, annexHttpHeadersCommand :: Maybe String
, annexAutoCommit :: Bool
+ , annexWebOptions :: [String]
}
extractGitConfig :: Git.Repo -> GitConfig
@@ -43,7 +44,7 @@ extractGitConfig r = GitConfig
, annexDiskReserve = fromMaybe onemegabyte $
readSize dataUnits =<< getmaybe "diskreserve"
, annexDirect = getbool "direct" False
- , annexBackends = fromMaybe [] $ words <$> getmaybe "backends"
+ , annexBackends = getwords "backends"
, annexQueueSize = getmayberead "queuesize"
, annexBloomCapacity = getmayberead "bloomcapacity"
, annexBloomAccuracy = getmayberead "bloomaccuracy"
@@ -53,6 +54,7 @@ extractGitConfig r = GitConfig
, annexHttpHeaders = getlist "http-headers"
, annexHttpHeadersCommand = getmaybe "http-headers-command"
, annexAutoCommit = getbool "autocommit" True
+ , annexWebOptions = getwords "web-options"
}
where
get k def = fromMaybe def $ getmayberead k
@@ -61,6 +63,7 @@ extractGitConfig r = GitConfig
getmayberead k = readish =<< getmaybe k
getmaybe k = Git.Config.getMaybe (key k) r
getlist k = Git.Config.getList (key k) r
+ getwords k = fromMaybe [] $ words <$> getmaybe k
key k = "annex." ++ k