This commit is contained in:
Joey Hess 2011-10-29 18:47:53 -04:00
parent 506282399c
commit 61000904d7
2 changed files with 13 additions and 9 deletions

View file

@ -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