summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-13 16:03:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-13 16:03:25 -0400
commit498c8e8544f04841d3221ce7a47b2409858e9f38 (patch)
treefb01cd7884ba68d6522c7dc3ad13821b555892a5 /Command/Fsck.hs
parentd9d79a7980b5c9a84823c0cf38750a0189d03b0a (diff)
fsck: avoid global checks if files specified
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs19
1 files changed, 13 insertions, 6 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index b0b9f7bb6..85a26a89b 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