diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-21 23:32:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-21 23:32:33 -0400 |
commit | ed79596b758935a3f22bf6803bc082a6bbe10f58 (patch) | |
tree | 885a8a50e68dafb39ec886cb31aa4c549fbeb35e /Command | |
parent | bee420bd2d0cbe16489b061b208083e2b8ba9d0e (diff) |
noop
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Fsck.hs | 2 | ||||
-rw-r--r-- | Command/Status.hs | 5 | ||||
-rw-r--r-- | Command/Unused.hs | 2 | ||||
-rw-r--r-- | Command/Whereis.hs | 12 |
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 |