summaryrefslogtreecommitdiff
path: root/Logs/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-15 11:57:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-15 11:57:27 -0400
commita360b311c7136ee8f570793d5322c335e5fe9da2 (patch)
treebc20bc6f2113791eaa538d809679d8390e29d55e /Logs/Unused.hs
parentbd8a6f2697c8271dc7127380ae18971284e3edf6 (diff)
Avoid encoding errors when using the unused log file.
Diffstat (limited to 'Logs/Unused.hs')
-rw-r--r--Logs/Unused.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Logs/Unused.hs b/Logs/Unused.hs
index b96143c07..cadf7ed9d 100644
--- a/Logs/Unused.hs
+++ b/Logs/Unused.hs
@@ -67,7 +67,7 @@ updateUnusedLog prefix m = do
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
writeUnusedLog prefix l = do
logfile <- fromRepo $ gitAnnexUnusedLog prefix
- liftIO $ viaTmp writeFile logfile $ unlines $ map format $ M.toList l
+ liftIO $ viaTmp writeFileAnyEncoding logfile $ unlines $ map format $ M.toList l
where
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
@@ -77,7 +77,7 @@ readUnusedLog prefix = do
f <- fromRepo $ gitAnnexUnusedLog prefix
ifM (liftIO $ doesFileExist f)
( M.fromList . mapMaybe parse . lines
- <$> liftIO (readFile f)
+ <$> liftIO (readFileStrictAnyEncoding f)
, return M.empty
)
where