summaryrefslogtreecommitdiff
path: root/Seek.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-11 00:51:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-11 00:51:07 -0400
commit264bd9ebe37855d4005022df057da13ec8080afb (patch)
treef32f13646ece29c8f6336b8680cb07dd55187be5 /Seek.hs
parentd9f5cc9f73ea046fcd2b59b5e75d4600593ac05b (diff)
where indenting
Diffstat (limited to 'Seek.hs')
-rw-r--r--Seek.hs43
1 files changed, 21 insertions, 22 deletions
diff --git a/Seek.hs b/Seek.hs
index 1f18861bc..cd3098664 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -35,21 +35,21 @@ withFilesNotInGit a params = do
seekunless (null ps && not (null params)) ps
dotfiles <- seekunless (null dotps) dotps
prepFiltered a $ return $ preserveOrder params (files++dotfiles)
- where
- (dotps, ps) = partition dotfile params
- seekunless True _ = return []
- seekunless _ l = do
- force <- Annex.getState Annex.force
- g <- gitRepo
- liftIO $ Git.Command.leaveZombie <$> LsFiles.notInRepo force l g
+ where
+ (dotps, ps) = partition dotfile params
+ seekunless True _ = return []
+ seekunless _ l = do
+ force <- Annex.getState Annex.force
+ g <- gitRepo
+ liftIO $ Git.Command.leaveZombie <$> LsFiles.notInRepo force l g
withPathContents :: ((FilePath, FilePath) -> CommandStart) -> CommandSeek
withPathContents a params = map a . concat <$> liftIO (mapM get params)
- where
- get p = ifM (isDirectory <$> getFileStatus p)
- ( map (\f -> (f, makeRelative p f)) <$> dirContentsRecursive p
- , return [(p, takeFileName p)]
- )
+ where
+ get p = ifM (isDirectory <$> getFileStatus p)
+ ( map (\f -> (f, makeRelative p f)) <$> dirContentsRecursive p
+ , return [(p, takeFileName p)]
+ )
withWords :: ([String] -> CommandStart) -> CommandSeek
withWords a params = return [a params]
@@ -59,10 +59,10 @@ withStrings a params = return $ map a params
withPairs :: ((String, String) -> CommandStart) -> CommandSeek
withPairs a params = return $ map a $ pairs [] params
- where
- pairs c [] = reverse c
- pairs c (x:y:xs) = pairs ((x,y):c) xs
- pairs _ _ = error "expected pairs"
+ where
+ pairs c [] = reverse c
+ pairs c (x:y:xs) = pairs ((x,y):c) xs
+ pairs _ _ = error "expected pairs"
withFilesToBeCommitted :: (String -> CommandStart) -> CommandSeek
withFilesToBeCommitted a params = prepFiltered a $
@@ -83,8 +83,8 @@ withFilesUnlocked' typechanged a params = do
withKeys :: (Key -> CommandStart) -> CommandSeek
withKeys a params = return $ map (a . parse) params
- where
- parse p = fromMaybe (error "bad key") $ file2key p
+ where
+ parse p = fromMaybe (error "bad key") $ file2key p
withValue :: Annex v -> (v -> CommandSeek) -> CommandSeek
withValue v a params = do
@@ -111,10 +111,9 @@ prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [Command
prepFiltered a fs = do
matcher <- Limit.getMatcher
map (process matcher) <$> fs
- where
- process matcher f = do
- ok <- matcher $ Annex.FileInfo f f
- if ok then a f else return Nothing
+ where
+ process matcher f = ifM (matcher $ Annex.FileInfo f f)
+ ( a f , return Nothing )
notSymlink :: FilePath -> IO Bool
notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f