more lambda-case conversion
This commit is contained in:
parent
936d50310d
commit
fc845e6530
29 changed files with 137 additions and 199 deletions
11
Annex/Ssh.hs
11
Annex/Ssh.hs
|
@ -101,9 +101,8 @@ sshCachingInfo :: (SshHost, Maybe Integer) -> Annex (Maybe FilePath, [CommandPar
|
|||
sshCachingInfo (host, port) = go =<< sshCacheDir
|
||||
where
|
||||
go Nothing = return (Nothing, [])
|
||||
go (Just dir) = do
|
||||
r <- liftIO $ bestSocketPath $ dir </> hostport2socket host port
|
||||
return $ case r of
|
||||
go (Just dir) =
|
||||
liftIO (bestSocketPath $ dir </> hostport2socket host port) >>= return . \case
|
||||
Nothing -> (Nothing, [])
|
||||
Just socketfile -> (Just socketfile, sshConnectionCachingParams socketfile)
|
||||
|
||||
|
@ -190,8 +189,7 @@ prepSocket socketfile gc sshhost sshparams = do
|
|||
liftIO $ createDirectoryIfMissing True $ parentDir socketfile
|
||||
let socketlock = socket2lock socketfile
|
||||
|
||||
c <- Annex.getState Annex.concurrency
|
||||
case c of
|
||||
Annex.getState Annex.concurrency >>= \case
|
||||
Concurrent {}
|
||||
| annexUUID (remoteGitConfig gc) /= NoUUID ->
|
||||
makeconnection socketlock
|
||||
|
@ -267,8 +265,7 @@ sshCleanup = mapM_ cleanup =<< enumSocketFiles
|
|||
let lockfile = socket2lock socketfile
|
||||
unlockFile lockfile
|
||||
mode <- annexFileMode
|
||||
v <- noUmask mode $ tryLockExclusive (Just mode) lockfile
|
||||
case v of
|
||||
noUmask mode (tryLockExclusive (Just mode) lockfile) >>= \case
|
||||
Nothing -> noop
|
||||
Just lck -> do
|
||||
forceStopSsh socketfile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue