From f1398b558316a936690a8f3b01493f498d15b659 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Mar 2012 00:23:15 -0400 Subject: use new getConfig --- Config.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Config.hs') 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) -- cgit v1.2.3