This commit is contained in:
Joey Hess 2012-04-21 23:32:33 -04:00
parent bee420bd2d
commit ed79596b75
27 changed files with 56 additions and 52 deletions

View file

@ -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 =

View file

@ -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 $

View file

@ -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)

View file

@ -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