From e0e4383fc0d105212c4f2c7e91d7b76e2eb0c2fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Oct 2013 17:16:29 -0400 Subject: assistant: Automatically repair damanged git repository, if it can be done without losing data. --- Assistant/Threads/Cronner.hs | 11 ++++------- debian/changelog | 2 ++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Assistant/Threads/Cronner.hs b/Assistant/Threads/Cronner.hs index d0d277d77..b2be122d8 100644 --- a/Assistant/Threads/Cronner.hs +++ b/Assistant/Threads/Cronner.hs @@ -33,7 +33,7 @@ import Assistant.WebApp.Types #endif import Git.Remote (RemoteName) import qualified Git.Fsck -import Logs.FsckResults +import Assistant.Repair import Control.Concurrent.Async import Control.Concurrent.MVar @@ -189,12 +189,9 @@ runActivity' urlrenderer (ScheduledSelfFsck _ d) = do r <- Git.Fsck.findBroken True g void $ batchCommand program (Param "fsck" : annexFsckParams d) return r - when (Git.Fsck.foundBroken fsckresults) $ do - u <- liftAnnex getUUID - liftAnnex $ writeFsckResults u fsckresults - button <- mkAlertButton True (T.pack "Click Here") urlrenderer $ - RepairRepositoryR u - void $ addAlert $ brokenRepositoryAlert button + when (Git.Fsck.foundBroken fsckresults) $ + brokenRepositoryDetected fsckresults urlrenderer + =<< liftAnnex getUUID mapM_ reget =<< liftAnnex (dirKeys gitAnnexBadDir) where reget k = queueTransfers "fsck found bad file; redownloading" Next k Nothing Download diff --git a/debian/changelog b/debian/changelog index 831aa029c..5aa553d67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ git-annex (4.20131025) UNRELEASED; urgency=low * directory, webdav: Fix bug introduced in version 4.20131002 that caused the chunkcount file to not be written. Work around repositories without such a file, so files can still be retreived from them. + * assistant: Automatically repair damanged git repository, if it can + be done without losing data. -- Joey Hess Sat, 26 Oct 2013 12:11:48 -0400 -- cgit v1.2.3