From 652f844e2348165062868cb197ee725d42198f03 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 29 Dec 2012 23:10:18 -0400 Subject: 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..* configuration settings. --- Annex/Ssh.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Annex/Ssh.hs') diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index cb46c06bc..d3622686c 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -18,9 +18,8 @@ import Common.Annex import Annex.LockPool import Annex.Perms #ifndef WITH_OLD_SSH -import qualified Git.Config -import Config import qualified Build.SysConfig as SysConfig +import qualified Annex #endif {- Generates parameters to ssh to a given host (or user@host) on a given @@ -60,8 +59,7 @@ sshInfo (host, port) = ifM caching caching = return False #else caching = fromMaybe SysConfig.sshconnectioncaching - . Git.Config.isTrue - <$> getConfig (annexConfig "sshcaching") "" + . annexSshCaching <$> Annex.getConfig #endif cacheParams :: FilePath -> [CommandParam] -- cgit v1.2.3