diff options
author | Joey Hess <joeyh@joeyh.name> | 2018-01-02 17:17:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2018-01-02 17:25:25 -0400 |
commit | ed2c1839fd8e0616165de569cff939dc3bf6527d (patch) | |
tree | 7dd4eed72c8a32ccd53f8bb75620e205eba514a5 /Logs/FsckResults.hs | |
parent | 2c16edc58f1f549cd4e5611c0f7c45fec6b66da0 (diff) |
Fix several places where files in .git/annex/ were written with modes that did not take the core.sharedRepository config into account.
git grep writeFile finds some more that might also be problems, but
for now I've concentrated on .git/annex/ log files. There are certianly
cases where writeFile is not a problem too.
This commit was sponsored by mo on Patreon.
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 |