summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-06-05 14:57:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-06-05 14:57:01 -0400
commit99b1e76bc3f1955f5ad0ca15321633270b696aed (patch)
tree5278334cc8c47ad24f36c7c144ea68c6c5589918 /Annex
parentee8906f78f0d4a1a115133483e9f3b5a1f68b2fe (diff)
Windows: Fix bug introduced in last release that caused files in the git-annex branch to have lines teminated with \r.
Diffstat (limited to 'Annex')
-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. -}