summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:32:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-21 23:32:33 -0400
commited79596b758935a3f22bf6803bc082a6bbe10f58 (patch)
tree885a8a50e68dafb39ec886cb31aa4c549fbeb35e /Command
parentbee420bd2d0cbe16489b061b208083e2b8ba9d0e (diff)
noop
Diffstat (limited to 'Command')
-rw-r--r--Command/Fsck.hs2
-rw-r--r--Command/Status.hs5
-rw-r--r--Command/Unused.hs2
-rw-r--r--Command/Whereis.hs12
4 files changed, 10 insertions, 11 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index c60101fc7..38b1bbbac 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -85,7 +85,7 @@ performRemote key file backend numcopies remote =
t <- fromRepo gitAnnexTmpDir
let tmp = t </> "fsck" ++ show pid ++ "." ++ keyFile key
liftIO $ createDirectoryIfMissing True t
- let cleanup = liftIO $ catchIO (removeFile tmp) (const $ return ())
+ let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
cleanup
cleanup `after` a tmp
getfile tmp =
diff --git a/Command/Status.hs b/Command/Status.hs
index 1ee36d8b4..0c6eda0b2 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -108,12 +108,11 @@ nojson :: StatState String -> String -> StatState String
nojson a _ = a
showStat :: Stat -> StatState ()
-showStat s = calc =<< s
+showStat s = maybe noop calc =<< s
where
- calc (Just (desc, a)) = do
+ calc (desc, a) = do
(lift . showHeader) desc
lift . showRaw =<< a
- calc Nothing = return ()
supported_backends :: Stat
supported_backends = stat "supported backends" $ json unwords $
diff --git a/Command/Unused.hs b/Command/Unused.hs
index bc721635b..5bdadcf44 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -268,7 +268,7 @@ withKeysReferencedInGitRef a ref = do
showAction $ "checking " ++ Git.Ref.describe ref
go =<< inRepo (LsTree.lsTree ref)
where
- go [] = return ()
+ go [] = noop
go (l:ls)
| isSymLink (LsTree.mode l) = do
content <- L.decodeUtf8 <$> catFile ref (LsTree.file l)
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index d4d268d93..eb6ea7c56 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -46,9 +46,9 @@ perform remotemap key = do
untrustedheader = "The following untrusted locations may also have copies:\n"
performRemote :: Key -> Remote -> Annex ()
-performRemote key remote = case whereisKey remote of
- Nothing -> return ()
- Just a -> do
- ls <- a key
- unless (null ls) $ showLongNote $
- unlines $ map (\l -> name remote ++ ": " ++ l) ls
+performRemote key remote = maybe noop go $ whereisKey remote
+ where
+ go a = do
+ ls <- a key
+ unless (null ls) $ showLongNote $ unlines $
+ map (\l -> name remote ++ ": " ++ l) ls