summaryrefslogtreecommitdiff
path: root/Command/Repair.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Repair.hs')
-rw-r--r--Command/Repair.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Command/Repair.hs b/Command/Repair.hs
new file mode 100644
index 000000000..0e655588b
--- /dev/null
+++ b/Command/Repair.hs
@@ -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