diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-08 15:15:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-08 15:15:21 -0400 |
commit | 070e8530c1151dc96dec099eac8b967277751b10 (patch) | |
tree | 8605013ee71aeafdb2bb89612cf3e2044882ab6d /Command/Fsck.hs | |
parent | 02a21d7f274568a2e2f94498607955aab8713a24 (diff) |
refactoring, no code changes really
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 785aecd8a..5405ce120 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -8,19 +8,11 @@ module Command.Fsck where import qualified Data.Map as M -import System.Directory -import System.Posix.Files -import Monad (filterM) -import Control.Monad.State (liftIO) -import Data.Maybe import Command import Types import Core -import Locations -import qualified Annex -import qualified GitRepo as Git -import qualified Backend +import Messages {- Checks the whole annex for problems. -} start :: SubCmdStart @@ -71,22 +63,3 @@ unusedKeys = do existsMap :: Ord k => [k] -> M.Map k Int existsMap l = M.fromList $ map (\k -> (k, 1)) l - -getKeysPresent :: Annex [Key] -getKeysPresent = do - g <- Annex.gitRepo - let top = annexDir g - contents <- liftIO $ getDirectoryContents top - files <- liftIO $ filterM (isreg top) contents - return $ map fileKey files - where - isreg top f = do - s <- getFileStatus $ top ++ "/" ++ f - return $ isRegularFile s - -getKeysReferenced :: Annex [Key] -getKeysReferenced = do - g <- Annex.gitRepo - files <- liftIO $ Git.inRepo g $ Git.workTree g - keypairs <- mapM Backend.lookupFile files - return $ map fst $ catMaybes keypairs |