summaryrefslogtreecommitdiff
path: root/Annex/Journal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Journal.hs')
-rw-r--r--Annex/Journal.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Annex/Journal.hs b/Annex/Journal.hs
index dcd3779de..4196a8225 100644
--- a/Annex/Journal.hs
+++ b/Annex/Journal.hs
@@ -40,7 +40,12 @@ setJournalFile _jl file content = do
jfile <- fromRepo $ journalFile file
let tmpfile = tmp </> takeFileName jfile
liftIO $ do
- writeFileAnyEncoding tmpfile content
+ withFile tmpfile WriteMode $ \h -> do
+ fileEncoding h
+#ifdef mingw32_HOST_OS
+ hSetNewlineMode h noNewlineTranslation
+#endif
+ hPutStr h content
moveFile tmpfile jfile
{- Gets any journalled content for a file in the branch. -}