diff --git a/Command.hs b/Command.hs index 4180155faf..3f68cf661f 100644 --- a/Command.hs +++ b/Command.hs @@ -126,8 +126,8 @@ backendPairs :: SubCmdSeekBackendFiles backendPairs a files = do pairs <- Backend.chooseBackends files return $ map a pairs -withDescription :: SubCmdSeekStrings -withDescription a params = return [a $ unwords params] +withString :: SubCmdSeekStrings +withString a params = return [a $ unwords params] withFilesToBeCommitted :: SubCmdSeekStrings withFilesToBeCommitted a params = do repo <- Annex.gitRepo @@ -143,8 +143,6 @@ withKeys :: SubCmdSeekStrings withKeys a params = return $ map a params withTempFile :: SubCmdSeekStrings withTempFile a params = return $ map a params -withNothing :: SubCmdSeekNothing -withNothing a _ = return [a] {- Default to acting on all files matching the seek action if - none are specified. -} diff --git a/Command/Fsck.hs b/Command/Fsck.hs index b0b9f7bb6b..85a26a89b9 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -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 diff --git a/Command/Init.hs b/Command/Init.hs index e3b05a83fa..8110948a41 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -19,7 +19,7 @@ import Version import Messages seek :: [SubCmdSeek] -seek = [withDescription start] +seek = [withString start] {- Stores description for the repository etc. -} start :: SubCmdStartString diff --git a/doc/walkthrough.mdwn b/doc/walkthrough.mdwn index a15f0a9a44..cdb2392e7a 100644 --- a/doc/walkthrough.mdwn +++ b/doc/walkthrough.mdwn @@ -295,7 +295,7 @@ You can also specifiy the files to check. This is particularly useful if you're using sha1 and don't want to spend a long time checksumming everything. # git annex fsck my_cool_big_file - fsck (checking for unused data...) ok + fsck (only checking specified files) ok fsck my_cool_big_file (checksum...) ok ## fsck: When things go wrong