summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-15 03:12:05 -0400
commite78475737636a5d1e0d0a36b475c300cc7bb56cc (patch)
tree1d88de569e951b66ff5321eefaec49ad4b33bf89 /Git
parent9bb797c0eae3c9d2f119a734762a6d5fa7321a80 (diff)
hlint tweaks
Did all sources except Remotes/* and Command/*
Diffstat (limited to 'Git')
-rw-r--r--Git/LsFiles.hs8
-rw-r--r--Git/Queue.hs4
-rw-r--r--Git/UnionMerge.hs2
3 files changed, 7 insertions, 7 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index b88c9144e..23b383a09 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -21,7 +21,7 @@ import Utility
{- Scans for files that are checked into git at the specified locations. -}
inRepo :: Repo -> [FilePath] -> IO [FilePath]
inRepo repo l = pipeNullSplit repo $
- [Params "ls-files --cached -z --"] ++ map File l
+ Params "ls-files --cached -z --" : map File l
{- Scans for files at the specified locations that are not checked into
- git. -}
@@ -44,12 +44,12 @@ staged' :: Repo -> [FilePath] -> [CommandParam] -> IO [FilePath]
staged' repo l middle = pipeNullSplit repo $ start ++ middle ++ end
where
start = [Params "diff --cached --name-only -z"]
- end = [Param "--"] ++ map File l
+ end = Param "--" : map File l
{- Returns a list of files that have unstaged changes. -}
changedUnstaged :: Repo -> [FilePath] -> IO [FilePath]
changedUnstaged repo l = pipeNullSplit repo $
- [Params "diff --name-only -z --"] ++ map File l
+ Params "diff --name-only -z --" : map File l
{- Returns a list of the files in the specified locations that are staged
- for commit, and whose type has changed. -}
@@ -65,4 +65,4 @@ typeChanged' :: Repo -> [FilePath] -> [CommandParam] -> IO [FilePath]
typeChanged' repo l middle = pipeNullSplit repo $ start ++ middle ++ end
where
start = [Params "diff --name-only --diff-filter=T -z"]
- end = [Param "--"] ++ map File l
+ end = Param "--" : map File l
diff --git a/Git/Queue.hs b/Git/Queue.hs
index e080476b7..0016be472 100644
--- a/Git/Queue.hs
+++ b/Git/Queue.hs
@@ -18,7 +18,7 @@ import qualified Data.Map as M
import System.IO
import System.Cmd.Utils
import Data.String.Utils
-import Control.Monad (unless, forM_)
+import Control.Monad (forM_)
import Utility
import Git
@@ -61,7 +61,7 @@ add (Queue n m) subcommand params files = Queue (n + 1) m'
-- can be a lot of files per item. So, optimise adding
-- files.
m' = M.insertWith' const action fs m
- fs = files ++ (M.findWithDefault [] action m)
+ fs = files ++ M.findWithDefault [] action m
{- Number of items in a queue. -}
size :: Queue -> Int
diff --git a/Git/UnionMerge.hs b/Git/UnionMerge.hs
index 4e0361b85..b0da07170 100644
--- a/Git/UnionMerge.hs
+++ b/Git/UnionMerge.hs
@@ -91,5 +91,5 @@ mergeFile g (info, file) = case filter (/= nullsha) [asha, bsha] of
return $ Just $ update_index_line sha file
where
[_colonamode, _bmode, asha, bsha, _status] = words info
- nullsha = take shaSize $ repeat '0'
+ nullsha = replicate shaSize '0'
unionmerge = unlines . nub . lines