diff options
author | 2012-03-14 17:43:34 -0400 | |
---|---|---|
committer | 2012-03-14 17:43:34 -0400 | |
commit | 60ab3d84e188b8dd3a284d962df25bbee41ff1cb (patch) | |
tree | 768d4f632bab0152dbc1ca72f81fc3b9c7915c0a /Annex/Ssh.hs | |
parent | a4f72c9625486786a4549cf4db1b542ea89da7c7 (diff) |
added ifM and nuked 11 lines of code
no behavior changes
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r-- | Annex/Ssh.hs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 39983ab25..79cfbe908 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -37,15 +37,17 @@ sshParams (host, port) opts = go =<< sshInfo (host, port) sshCleanup sshInfo :: (String, Maybe Integer) -> Annex (Maybe FilePath, [CommandParam]) -sshInfo (host, port) = do - caching <- fromMaybe SysConfig.sshconnectioncaching . Git.configTrue - <$> fromRepo (Git.Config.get "annex.sshcaching" "") - if caching - then do - dir <- fromRepo gitAnnexSshDir - let socketfile = dir </> hostport2socket host port - return (Just socketfile, cacheParams socketfile) - else return (Nothing, []) +sshInfo (host, port) = ifM caching + ( do + dir <- fromRepo gitAnnexSshDir + let socketfile = dir </> hostport2socket host port + return (Just socketfile, cacheParams socketfile) + , return (Nothing, []) + ) + where + caching = fromMaybe SysConfig.sshconnectioncaching + . Git.configTrue + <$> fromRepo (Git.Config.get "annex.sshcaching" "") cacheParams :: FilePath -> [CommandParam] cacheParams socketfile = |