summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-03 03:52:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-03 03:52:41 -0400
commit6543d5406c64bb00a58e74305ec9ca09a49faf0b (patch)
tree5e33ceb3ea5b5bf5ad4f2cbb7d08b19cb1026897 /Annex
parentf0dd3c6c1624cb5441eab175c6f5a683d3806885 (diff)
hlint
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Branch.hs6
-rw-r--r--Annex/Content/Direct.hs3
-rw-r--r--Annex/Direct.hs2
-rw-r--r--Annex/FileMatcher.hs6
-rw-r--r--Annex/Ssh.hs2
5 files changed, 9 insertions, 10 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 4a36de66a..021cd3926 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -189,7 +189,7 @@ change file a = lockJournal $ a <$> getStale file >>= set file
{- Records new content of a file into the journal -}
set :: FilePath -> String -> Annex ()
-set file content = setJournalFile file content
+set = setJournalFile
{- Stages the journal, and commits staged changes to the branch. -}
commit :: String -> Annex ()
@@ -197,7 +197,7 @@ commit message = whenM journalDirty $ lockJournal $ do
cleanjournal <- stageJournal
ref <- getBranch
withIndex $ commitBranch ref message [fullname]
- liftIO $ cleanjournal
+ liftIO cleanjournal
{- Commits the staged changes in the index to the branch.
-
@@ -355,7 +355,7 @@ stageJournal = withIndex $ do
Git.UpdateIndex.streamUpdateIndex g
[genstream dir h fs]
hashObjectStop h
- return $ liftIO $ mapM_ removeFile $ map (dir </>) fs
+ return $ liftIO $ mapM_ (removeFile . (dir </>)) fs
where
genstream dir h fs streamer = forM_ fs $ \file -> do
let path = dir </> file
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index bbf6e310d..25e257918 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -139,11 +139,10 @@ sameFileStatus :: Key -> FileStatus -> Annex Bool
sameFileStatus key status = do
old <- recordedInodeCache key
let curr = toInodeCache status
- r <- case (old, curr) of
+ case (old, curr) of
(Just o, Just c) -> compareInodeCaches o c
(Nothing, Nothing) -> return True
_ -> return False
- return r
{- If the inodes have changed, only the size and mtime are compared. -}
compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index a88a045e7..7836ceb96 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -122,7 +122,7 @@ mergeDirectCleanup :: FilePath -> Git.Ref -> Git.Ref -> Annex ()
mergeDirectCleanup d oldsha newsha = do
(items, cleanup) <- inRepo $ DiffTree.diffTreeRecursive oldsha newsha
forM_ items updated
- void $ liftIO $ cleanup
+ void $ liftIO cleanup
liftIO $ removeDirectoryRecursive d
where
updated item = do
diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs
index c32402baf..220fea286 100644
--- a/Annex/FileMatcher.hs
+++ b/Annex/FileMatcher.hs
@@ -47,7 +47,7 @@ parsedToMatcher parsed = case partitionEithers parsed of
parseToken :: MkLimit -> GroupMap -> String -> Either String (Token MatchFiles)
parseToken checkpresent groupmap t
- | any (== t) Utility.Matcher.tokens = Right $ Utility.Matcher.token t
+ | t `elem` tokens = Right $ token t
| t == "present" = use checkpresent
| otherwise = maybe (Left $ "near " ++ show t) use $ M.lookup k $
M.fromList
@@ -61,7 +61,7 @@ parseToken checkpresent groupmap t
]
where
(k, v) = separate (== '=') t
- use a = Utility.Matcher.Operation <$> a v
+ use a = Operation <$> a v
{- This is really dumb tokenization; there's no support for quoted values.
- Open and close parens are always treated as standalone tokens;
@@ -76,7 +76,7 @@ tokenizeMatcher = filter (not . null ) . concatMap splitparens . words
largeFilesMatcher :: Annex FileMatcher
largeFilesMatcher = go =<< annexLargeFiles <$> Annex.getGitConfig
where
- go Nothing = return $ matchAll
+ go Nothing = return matchAll
go (Just expr) = do
m <- groupMap
u <- getUUID
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index a8bd1f7b6..0b8ce3b93 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -79,7 +79,7 @@ sshCacheDir
gettmpdir = liftIO $ getEnv "GIT_ANNEX_TMP_DIR"
usetmpdir tmpdir = liftIO $ catchMaybeIO $ do
createDirectoryIfMissing True tmpdir
- return $ tmpdir
+ return tmpdir
portParams :: Maybe Integer -> [CommandParam]
portParams Nothing = []