aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-25 03:09:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-25 03:09:06 -0400
commitd9c5d32c34885cac67c44c633c5351461902d166 (patch)
tree2628093b15b5564a33364cf67d54d87ef0f2474e /Annex
parent2270913743982ab33c68d17c8ed68326e1711f95 (diff)
hlint
test suite still passes
Diffstat (limited to 'Annex')
-rw-r--r--Annex/CheckIgnore.hs2
-rw-r--r--Annex/Content.hs2
-rw-r--r--Annex/Content/Direct.hs2
-rw-r--r--Annex/Environment.hs2
-rw-r--r--Annex/Exception.hs2
-rw-r--r--Annex/Link.hs6
-rw-r--r--Annex/Quvi.hs2
-rw-r--r--Annex/Ssh.hs8
8 files changed, 13 insertions, 13 deletions
diff --git a/Annex/CheckIgnore.hs b/Annex/CheckIgnore.hs
index e5626557d..d45e652bc 100644
--- a/Annex/CheckIgnore.hs
+++ b/Annex/CheckIgnore.hs
@@ -25,7 +25,7 @@ checkIgnoreHandle :: Annex (Maybe Git.CheckIgnoreHandle)
checkIgnoreHandle = maybe startup return =<< Annex.getState Annex.checkignorehandle
where
startup = do
- v <- inRepo $ Git.checkIgnoreStart
+ v <- inRepo Git.checkIgnoreStart
when (isNothing v) $
warning "The installed version of git is too old for .gitignores to be honored by git-annex."
Annex.changeState $ \s -> s { Annex.checkignorehandle = Just v }
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 25ee4c7db..c7afa8070 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -275,7 +275,7 @@ moveAnnex key src = withObjectLoc key storeobject storedirect
thawContentDir =<< calcRepo (gitAnnexLocation key)
thawContent src
v <- isAnnexLink f
- if (Just key == v)
+ if Just key == v
then do
updateInodeCache key src
replaceFile f $ liftIO . moveFile src
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 6da7fab52..3de6b12a3 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -199,7 +199,7 @@ compareInodeCachesWith = ifM inodesChanged ( return Weakly, return Strongly )
addContentWhenNotPresent :: Key -> FilePath -> FilePath -> Annex ()
addContentWhenNotPresent key contentfile associatedfile = do
v <- isAnnexLink associatedfile
- when (Just key == v) $ do
+ when (Just key == v) $
replaceFile associatedfile $
liftIO . void . copyFileExternal contentfile
updateInodeCache key associatedfile
diff --git a/Annex/Environment.hs b/Annex/Environment.hs
index ae5a5646f..f22c5f2d4 100644
--- a/Annex/Environment.hs
+++ b/Annex/Environment.hs
@@ -32,7 +32,7 @@ import Utility.Env
checkEnvironment :: Annex ()
checkEnvironment = do
gitusername <- fromRepo $ Git.Config.getMaybe "user.name"
- when (gitusername == Nothing || gitusername == Just "") $
+ when (isNothing gitusername || gitusername == Just "") $
liftIO checkEnvironmentIO
checkEnvironmentIO :: IO ()
diff --git a/Annex/Exception.hs b/Annex/Exception.hs
index 99466a851..040229d65 100644
--- a/Annex/Exception.hs
+++ b/Annex/Exception.hs
@@ -24,7 +24,7 @@ import Common.Annex
{- Runs an Annex action, with setup and cleanup both in the IO monad. -}
bracketIO :: IO v -> (v -> IO b) -> (v -> Annex a) -> Annex a
-bracketIO setup cleanup go = M.bracket (liftIO setup) (liftIO . cleanup) go
+bracketIO setup cleanup = M.bracket (liftIO setup) (liftIO . cleanup)
{- try in the Annex monad -}
tryAnnex :: Annex a -> Annex (Either SomeException a)
diff --git a/Annex/Link.hs b/Annex/Link.hs
index becd7e7ec..30d8c2ae8 100644
--- a/Annex/Link.hs
+++ b/Annex/Link.hs
@@ -68,9 +68,9 @@ getAnnexLinkTarget file = ifM (coreSymlinks <$> Annex.getGitConfig)
-- characters, or whitespace, we
-- certianly don't have a link to a
-- git-annex key.
- if any (`elem` s) "\0\n\r \t"
- then return ""
- else return s
+ return $ if any (`elem` s) "\0\n\r \t"
+ then ""
+ else s
{- Creates a link on disk.
-
diff --git a/Annex/Quvi.hs b/Annex/Quvi.hs
index a79b17d61..b0725bae7 100644
--- a/Annex/Quvi.hs
+++ b/Annex/Quvi.hs
@@ -14,7 +14,7 @@ import qualified Annex
import Utility.Quvi
import Utility.Url
-withQuviOptions :: forall a. (Query a) -> [CommandParam] -> URLString -> Annex a
+withQuviOptions :: forall a. Query a -> [CommandParam] -> URLString -> Annex a
withQuviOptions a ps url = do
opts <- map Param . annexQuviOptions <$> Annex.getGitConfig
liftIO $ a (ps++opts) url
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 6fd2c556c..3b1e4b457 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -42,7 +42,7 @@ sshCachingOptions (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 (not . any isLock . M.keys <$> getPool) $
+ cleanstale = whenM (not . any isLock . M.keys <$> getPool)
sshCleanup
{- Returns a filename to use for a ssh connection caching socket, and
@@ -57,9 +57,9 @@ sshInfo (host, port) = go =<< sshCacheDir
then return (Just socketfile, sshConnectionCachingParams socketfile)
else do
socketfile' <- liftIO $ relPathCwdToFile socketfile
- if valid_unix_socket_path socketfile'
- then return (Just socketfile', sshConnectionCachingParams socketfile')
- else return (Nothing, [])
+ return $ if valid_unix_socket_path socketfile'
+ then (Just socketfile', sshConnectionCachingParams socketfile')
+ else (Nothing, [])
sshConnectionCachingParams :: FilePath -> [CommandParam]
sshConnectionCachingParams socketfile =