fsck: avoid global checks if files specified

This commit is contained in:
Joey Hess 2010-11-13 16:03:25 -04:00
parent d9d79a7980
commit 498c8e8544
4 changed files with 17 additions and 12 deletions

View file

@ -16,13 +16,20 @@ import Messages
import qualified Command.FsckFile
seek :: [SubCmdSeek]
seek = [withNothing start, withAll withFilesInGit Command.FsckFile.start]
seek = [withString start, withAll withFilesInGit Command.FsckFile.start]
{- Checks the whole annex for problems. -}
start :: SubCmdStart
start = do
showStart "fsck" ""
return $ Just perform
{- Checks the whole annex for problems, only if specific files were not
- specified. -}
start :: SubCmdStartString
start whatspecified = do
if (null whatspecified)
then do
showStart "fsck" ""
return $ Just perform
else do
showStart "fsck" ""
showNote "only checking specified files"
return $ Just $ return $ Just $ return True
perform :: SubCmdPerform
perform = do