summaryrefslogtreecommitdiff
path: root/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-22 00:23:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-22 17:32:47 -0400
commitf1398b558316a936690a8f3b01493f498d15b659 (patch)
treeac58768f5e421b985f3a2ed135bb338b03a991ec /Config.hs
parent4eb51126819fe01a003688267f481c6d8014ef47 (diff)
use new getConfig
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Config.hs b/Config.hs
index 39fe3333b..f20298485 100644
--- a/Config.hs
+++ b/Config.hs
@@ -32,9 +32,8 @@ getConfig key def = fromRepo $ Git.Config.get key def
{- Looks up a per-remote config setting in git config.
- Failing that, tries looking for a global config option. -}
getRemoteConfig :: Git.Repo -> ConfigKey -> String -> Annex String
-getRemoteConfig r key def = do
- def' <- getConfig key def
- fromRepo $ Git.Config.get (remoteConfig r key) def'
+getRemoteConfig r key def =
+ getConfig (remoteConfig r key) =<< getConfig key def
{- A per-remote config setting in git config. -}
remoteConfig :: Git.Repo -> ConfigKey -> String
@@ -85,9 +84,8 @@ getNumCopies v = perhaps (use v) =<< Annex.getState Annex.forcenumcopies
where
use (Just n) = return n
use Nothing = perhaps (return 1) =<<
- readish <$> fromRepo (Git.Config.get config "1")
+ readish <$> getConfig "annex.numcopies" "1"
perhaps fallback = maybe fallback (return . id)
- config = "annex.numcopies"
{- Gets the trust level set for a remote in git config. -}
getTrustLevel :: Git.Repo -> Annex (Maybe String)