From d72fb5acc28af3ea6380dd09518f7d1382dea8d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jun 2011 00:35:51 -0400 Subject: Fix encoding of utf-8 etc when storing the description of repository and other content. Write files in raw mode, to avoid mangling the encoding of content provided. Note: This was a longstanding problem, it was not introduced in v3. --- Branch.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Branch.hs') diff --git a/Branch.hs b/Branch.hs index 9cdb096fd..ab24e4752 100644 --- a/Branch.hs +++ b/Branch.hs @@ -26,6 +26,7 @@ import System.Cmd.Utils import Data.Maybe import Data.List import System.IO +import System.IO.Binary import qualified Data.ByteString.Char8 as B import Types.BranchState @@ -287,7 +288,7 @@ setJournalFile file content = do write g = do let jfile = journalFile g file let tmpfile = gitAnnexTmpDir g takeFileName jfile - writeFile tmpfile content + writeBinaryFile tmpfile content renameFile tmpfile jfile {- Gets journalled content for a file in the branch. -} -- cgit v1.2.3