summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Cronner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-26 17:16:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-26 17:16:29 -0400
commite0e4383fc0d105212c4f2c7e91d7b76e2eb0c2fe (patch)
tree35f6d004cba8a5c9eb19267a7904a611779c5973 /Assistant/Threads/Cronner.hs
parent35f4b77d7c9a0d413a5dabcd8ce15ad6388d582f (diff)
assistant: Automatically repair damanged git repository, if it can be done without losing data.
Diffstat (limited to 'Assistant/Threads/Cronner.hs')
-rw-r--r--Assistant/Threads/Cronner.hs11
1 files changed, 4 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