diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-29 18:47:53 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-29 18:47:53 -0400 |
commit | 61000904d74ffd4745dd6808bcfa88289affc169 (patch) | |
tree | 55a4363c1b3dbcd59b9180b395195e7511ad20a7 /Command/Fsck.hs | |
parent | 506282399cc09f652514073993bfc8773cd12aac (diff) |
refactor
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 6f184a760..1f30d2eb6 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -13,7 +13,6 @@ import qualified Remote import qualified Types.Backend import qualified Types.Key import qualified Backend -import qualified Git import Annex.Content import Logs.Location import Logs.Trust @@ -44,14 +43,13 @@ perform key file backend numcopies = check {- To fsck a bare repository, fsck each key in the location log. -} withBarePresentKeys :: (Key -> CommandStart) -> CommandSeek -withBarePresentKeys a params = do - bare <- Git.repoIsLocalBare <$> gitRepo - if bare - then do +withBarePresentKeys a params = isBareRepo >>= go + where + go False = return [] + go True = do unless (null params) $ do error "fsck should be run without parameters in a bare repository" - liftM (map a) loggedKeys - else return [] + runActions a loggedKeys startBare :: Key -> CommandStart startBare key = case Backend.maybeLookupBackendName (Types.Key.keyBackendName key) of |