summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-15 18:22:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-15 18:22:50 -0400
commit11096c200f4050c1e4cdb4fbab9410055c6e1c02 (patch)
treedbf8ef11c48fbf5ff9e2031d3280ff3e9bc8423b /Command
parentd6f7ee7db46208d132f305ab651b0bf082be348e (diff)
fsck no longer runs unused
Diffstat (limited to 'Command')
-rw-r--r--Command/Fsck.hs20
1 files changed, 17 insertions, 3 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index a72d753fa..07621ad4e 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -8,8 +8,22 @@
module Command.Fsck where
import Command
-import qualified Command.FsckFile
-import qualified Command.Unused
+import qualified Backend
+import Types
+import Messages
seek :: [SubCmdSeek]
-seek = [withNothing Command.Unused.start, withAll withFilesInGit Command.FsckFile.start]
+seek = [withFilesInGit start]
+
+{- Checks a file's backend data for problems. -}
+start :: SubCmdStartString
+start file = isAnnexed file $ \(key, backend) -> do
+ showStart "fsck" file
+ return $ Just $ perform key backend
+
+perform :: Key -> Backend -> SubCmdPerform
+perform key backend = do
+ success <- Backend.fsckKey backend key
+ if (success)
+ then return $ Just $ return True
+ else return Nothing