add repair command

This commit is contained in:
Joey Hess 2013-10-23 12:21:59 -04:00
parent 6b7f1baa6a
commit d5eb85acf4
6 changed files with 154 additions and 87 deletions

25
Command/Repair.hs Normal file
View file

@ -0,0 +1,25 @@
{- git-annex command
-
- Copyright 2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Repair where
import Common.Annex
import Command
import qualified Annex
import Git.RecoverRepository (runRecovery)
def :: [Command]
def = [noCommit $ dontCheck repoExists $
command "repair" paramNothing seek SectionMaintenance "recover broken git repository"]
seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
start = next $ next $ do
force <- Annex.getState Annex.force
inRepo $ runRecovery force