From 6295ec998fb65607fb8c1d88035b41fa0cb3b0d6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 Feb 2014 10:08:28 -0400 Subject: factor out utility function --- Annex/Content/Direct.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Annex/Content') diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index a5d71288b..35d2c9b8d 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -66,15 +66,10 @@ changeAssociatedFiles key transform = do let files' = transform files when (files /= files') $ do modifyContent mapping $ - liftIO $ viaTmp write mapping $ unlines files' + liftIO $ viaTmp writeFileAnyEncoding mapping $ + unlines files' top <- fromRepo Git.repoPath return $ map (top ) files' - where - write file content = do - h <- openFile file WriteMode - fileEncoding h - hPutStr h content - hClose h {- Removes the list of associated files. -} removeAssociatedFiles :: Key -> Annex () -- cgit v1.2.3