summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-12 13:20:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-12 13:20:58 -0400
commitcf7b91b46d3520d9c522846e02a6cb2c01ba39eb (patch)
treea475509bdc76c25553b495a7c922117629dd4f76
parent769daae61d888e080d0991776935685b444b807a (diff)
where indentation
-rw-r--r--Git/LsFiles.hs70
1 files changed, 35 insertions, 35 deletions
diff --git a/Git/LsFiles.hs b/Git/LsFiles.hs
index 4edd6cefc..fce9d44f4 100644
--- a/Git/LsFiles.hs
+++ b/Git/LsFiles.hs
@@ -30,12 +30,12 @@ inRepo l = pipeNullSplit $ Params "ls-files --cached -z --" : map File l
{- Scans for files at the specified locations that are not checked into git. -}
notInRepo :: Bool -> [FilePath] -> Repo -> IO ([FilePath], IO Bool)
notInRepo include_ignored l repo = pipeNullSplit params repo
- where
- params = [Params "ls-files --others"] ++ exclude ++
- [Params "-z --"] ++ map File l
- exclude
- | include_ignored = []
- | otherwise = [Param "--exclude-standard"]
+ where
+ params = [Params "ls-files --others"] ++ exclude ++
+ [Params "-z --"] ++ map File l
+ exclude
+ | include_ignored = []
+ | otherwise = [Param "--exclude-standard"]
{- Returns a list of all files that are staged for commit. -}
staged :: [FilePath] -> Repo -> IO ([FilePath], IO Bool)
@@ -48,9 +48,9 @@ stagedNotDeleted = staged' [Param "--diff-filter=ACMRT"]
staged' :: [CommandParam] -> [FilePath] -> Repo -> IO ([FilePath], IO Bool)
staged' ps l = pipeNullSplit $ prefix ++ ps ++ suffix
- where
- prefix = [Params "diff --cached --name-only -z"]
- suffix = Param "--" : map File l
+ where
+ prefix = [Params "diff --cached --name-only -z"]
+ suffix = Param "--" : map File l
{- Returns a list of the files in the specified locations that are staged
- for commit, and whose type has changed. -}
@@ -70,9 +70,9 @@ typeChanged' ps l repo = do
let top = repoPath repo
cwd <- getCurrentDirectory
return (map (\f -> relPathDirToFile cwd $ top </> f) fs, cleanup)
- where
- prefix = [Params "diff --name-only --diff-filter=T -z"]
- suffix = Param "--" : map File l
+ where
+ prefix = [Params "diff --name-only --diff-filter=T -z"]
+ suffix = Param "--" : map File l
{- A item in conflict has two possible values.
- Either can be Nothing, when that side deleted the file. -}
@@ -101,8 +101,8 @@ unmerged :: [FilePath] -> Repo -> IO ([Unmerged], IO Bool)
unmerged l repo = do
(fs, cleanup) <- pipeNullSplit params repo
return (reduceUnmerged [] $ catMaybes $ map parseUnmerged fs, cleanup)
- where
- params = Params "ls-files --unmerged -z --" : map File l
+ where
+ params = Params "ls-files --unmerged -z --" : map File l
data InternalUnmerged = InternalUnmerged
{ isus :: Bool
@@ -124,28 +124,28 @@ parseUnmerged s
return $ InternalUnmerged (stage == 2) file
(Just blobtype) (Just sha)
_ -> Nothing
- where
- (metadata, file) = separate (== '\t') s
+ where
+ (metadata, file) = separate (== '\t') s
reduceUnmerged :: [Unmerged] -> [InternalUnmerged] -> [Unmerged]
reduceUnmerged c [] = c
reduceUnmerged c (i:is) = reduceUnmerged (new:c) rest
- where
- (rest, sibi) = findsib i is
- (blobtypeA, blobtypeB, shaA, shaB)
- | isus i = (iblobtype i, iblobtype sibi, isha i, isha sibi)
- | otherwise = (iblobtype sibi, iblobtype i, isha sibi, isha i)
- new = Unmerged
- { unmergedFile = ifile i
- , unmergedBlobType = Conflicting blobtypeA blobtypeB
- , unmergedSha = Conflicting shaA shaB
- }
- findsib templatei [] = ([], deleted templatei)
- findsib templatei (l:ls)
- | ifile l == ifile templatei = (ls, l)
- | otherwise = (l:ls, deleted templatei)
- deleted templatei = templatei
- { isus = not (isus templatei)
- , iblobtype = Nothing
- , isha = Nothing
- }
+ where
+ (rest, sibi) = findsib i is
+ (blobtypeA, blobtypeB, shaA, shaB)
+ | isus i = (iblobtype i, iblobtype sibi, isha i, isha sibi)
+ | otherwise = (iblobtype sibi, iblobtype i, isha sibi, isha i)
+ new = Unmerged
+ { unmergedFile = ifile i
+ , unmergedBlobType = Conflicting blobtypeA blobtypeB
+ , unmergedSha = Conflicting shaA shaB
+ }
+ findsib templatei [] = ([], deleted templatei)
+ findsib templatei (l:ls)
+ | ifile l == ifile templatei = (ls, l)
+ | otherwise = (l:ls, deleted templatei)
+ deleted templatei = templatei
+ { isus = not (isus templatei)
+ , iblobtype = Nothing
+ , isha = Nothing
+ }