summaryrefslogtreecommitdiff
path: root/Annex/Ssh.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-16 00:41:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-16 00:44:51 -0400
commita1e52f0ce5984058c737ed709fc5d4b6398e019a (patch)
treebaaeb46b5eb5e7edb4a8a4ef80d6c1ab256bbcba /Annex/Ssh.hs
parente7aaa55c53fb54c6dd5a1a1aeb0955b05227676b (diff)
hlint
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r--Annex/Ssh.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 184eb92ca..df9f0e410 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -32,7 +32,7 @@ sshParams (host, port) opts = go =<< sshInfo (host, port)
-- If the lock pool is empty, this is the first ssh of this
-- run. There could be stale ssh connections hanging around
-- from a previous git-annex run that was interrupted.
- cleanstale = whenM (null . filter isLock . M.keys <$> getPool) $
+ cleanstale = whenM (not . any isLock . M.keys <$> getPool) $
sshCleanup
sshInfo :: (String, Maybe Integer) -> Annex (Maybe FilePath, [CommandParam])
@@ -40,9 +40,9 @@ sshInfo (host, port) = do
caching <- Git.configTrue <$> fromRepo (Git.Config.get "annex.sshcaching" "true")
if caching
then do
- dir <- fromRepo $ gitAnnexSshDir
+ dir <- fromRepo gitAnnexSshDir
let socketfile = dir </> hostport2socket host port
- return $ (Just socketfile, cacheParams socketfile)
+ return (Just socketfile, cacheParams socketfile)
else return (Nothing, [])
cacheParams :: FilePath -> [CommandParam]
@@ -58,7 +58,7 @@ portParams (Just port) = [Param "-p", Param $ show port]
{- Stop any unused ssh processes. -}
sshCleanup :: Annex ()
sshCleanup = do
- dir <- fromRepo $ gitAnnexSshDir
+ dir <- fromRepo gitAnnexSshDir
liftIO $ createDirectoryIfMissing True dir
sockets <- filter (not . isLock) <$> liftIO (dirContents dir)
forM_ sockets cleanup