merge from git-repair

This commit is contained in:
Joey Hess 2021-01-11 21:57:35 -04:00
parent 8a1256bdf1
commit dc0caef297
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -464,14 +464,19 @@ runRepair removablebranch forced g = do
putStrLn "Running git fsck ..."
fsckresult <- findBroken False g
if foundBroken fsckresult
then runRepair' removablebranch fsckresult forced Nothing g
then do
putStrLn "Fsck found problems, attempting repair."
runRepair' removablebranch fsckresult forced Nothing g
else do
putStrLn "Fsck found no problems. Checking for broken branches."
bad <- badBranches S.empty g
if null bad
then do
putStrLn "No problems found."
return (True, [])
else runRepair' removablebranch fsckresult forced Nothing g
else do
putStrLn "Found problems, attempting repair."
runRepair' removablebranch fsckresult forced Nothing g
runRepairOf :: FsckResults -> (Ref -> Bool) -> Bool -> Maybe FilePath -> Repo -> IO (Bool, [Branch])
runRepairOf fsckresult removablebranch forced referencerepo g = do