diff options
Diffstat (limited to 'Logs/FsckResults.hs')
-rw-r--r-- | Logs/FsckResults.hs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Logs/FsckResults.hs b/Logs/FsckResults.hs index 09430e806..296847fa4 100644 --- a/Logs/FsckResults.hs +++ b/Logs/FsckResults.hs @@ -12,25 +12,22 @@ module Logs.FsckResults ( ) where import Annex.Common -import Utility.Tmp import Git.Fsck import Git.Types +import Logs.File import qualified Data.Set as S writeFsckResults :: UUID -> FsckResults -> Annex () writeFsckResults u fsckresults = do logfile <- fromRepo $ gitAnnexFsckResultsLog u - liftIO $ - case fsckresults of - FsckFailed -> store S.empty False logfile - FsckFoundMissing s t - | S.null s -> nukeFile logfile - | otherwise -> store s t logfile + case fsckresults of + FsckFailed -> store S.empty False logfile + FsckFoundMissing s t + | S.null s -> liftIO $ nukeFile logfile + | otherwise -> store s t logfile where - store s t logfile = do - createDirectoryIfMissing True (parentDir logfile) - liftIO $ viaTmp writeFile logfile $ serialize s t + store s t logfile = writeLogFile logfile $ serialize s t serialize s t = let ls = map fromRef (S.toList s) in if t |