summaryrefslogtreecommitdiff
path: root/Command/Repair.hs
blob: 0e655588b7f6bbf817ac1e6abc4d7f0dd1d23491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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