summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-05-27 15:22:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-05-27 15:22:52 -0400
commit74a94ddfac2940575721826911dd8b15a74011e5 (patch)
tree708eabf87ee668eaaa7d9944a2bdc90988a6d494 /Git
parent38bd7ca3cce455c20edcee656c706939087c6a69 (diff)
Windows: Avoid terminating git-annex branch lines with \r\n when union merging.
Diffstat (limited to 'Git')
-rw-r--r--Git/HashObject.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Git/HashObject.hs b/Git/HashObject.hs
index 07c72d080..ed3baf4c6 100644
--- a/Git/HashObject.hs
+++ b/Git/HashObject.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Git.HashObject where
import Common
@@ -39,6 +41,10 @@ hashFile h file = CoProcess.query h send receive
- interface does not allow batch hashing without using temp files. -}
hashBlob :: HashObjectHandle -> String -> IO Sha
hashBlob h s = withTmpFile "hash" $ \tmp tmph -> do
+ fileEncoding tmph
+#ifdef mingw32_HOST_OS
+ hSetNewlineMode tmph noNewlineTranslation
+#endif
hPutStr tmph s
hClose tmph
hashFile h tmp