summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
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