diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-16 00:41:30 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-16 00:44:51 -0400 |
commit | a1e52f0ce5984058c737ed709fc5d4b6398e019a (patch) | |
tree | baaeb46b5eb5e7edb4a8a4ef80d6c1ab256bbcba /Annex | |
parent | e7aaa55c53fb54c6dd5a1a1aeb0955b05227676b (diff) |
hlint
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Branch.hs | 4 | ||||
-rw-r--r-- | Annex/Ssh.hs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 388cbc12d..acab417fb 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -116,7 +116,7 @@ updateTo pairs = do -- check what needs updating before taking the lock dirty <- journalDirty (refs, branches) <- unzip <$> filterM isnewer pairs - if (not dirty && null refs) + if not dirty && null refs then updateIndex branchref else withIndex $ lockJournal $ do when dirty stageJournal @@ -172,7 +172,7 @@ get' staleok file = fromcache =<< getCache file - modifes the current content of the file on the branch. -} change :: FilePath -> (String -> String) -> Annex () -change file a = lockJournal $ getStale file >>= return . a >>= set file +change file a = lockJournal $ a <$> getStale file >>= set file {- Records new content of a file into the journal and cache. -} set :: FilePath -> String -> Annex () 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 |