added ifM and nuked 11 lines of code
no behavior changes
This commit is contained in:
parent
a4f72c9625
commit
60ab3d84e1
17 changed files with 151 additions and 162 deletions
20
Annex/Ssh.hs
20
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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue