merge improved fsck types from git-repair and some associated changes

This commit is contained in:
Joey Hess 2013-11-30 14:29:11 -04:00
parent a8e8bd4360
commit 6edac746f0
6 changed files with 57 additions and 46 deletions

View file

@ -26,6 +26,7 @@ import Utility.NotificationBroadcaster
import Config
import Utility.HumanTime
import Git.Repair
import Git.Index
import Data.Time.Clock.POSIX
import qualified Data.Set as S
@ -43,7 +44,7 @@ sanityCheckerStartupThread startupdelay = namedThreadUnchecked "SanityCheckerSta
ifM (not <$> liftAnnex (inRepo (checkIndex S.empty)))
( do
notice ["corrupt index file found at startup; removing and restaging"]
liftAnnex $ inRepo nukeIndex
liftAnnex $ inRepo $ nukeFile . indexFile
{- Normally the startup scan avoids re-staging files,
- but with the index deleted, everything needs to be
- restaged. -}