diff options
author | Joey Hess <id@joeyh.name> | 2013-05-11 16:02:35 -0500 |
---|---|---|
committer | Joey Hess <id@joeyh.name> | 2013-05-11 16:02:35 -0500 |
commit | 19ba07456f14db4aacf41be18673a06c9a04fa17 (patch) | |
tree | abfbed8d90b35672b69a43de95f68cf053fbf976 /Git/HashObject.hs | |
parent | ee869b08ffad4078067d5985025511311805e6f2 (diff) |
git annex init works on Windows!
git hash-object and cat-file both only use \n at ends of line, even on Windows.
Diffstat (limited to 'Git/HashObject.hs')
-rwxr-xr-x[-rw-r--r--] | Git/HashObject.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Git/HashObject.hs b/Git/HashObject.hs index b4a32ef1c..5e153687d 100644..100755 --- 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 @@ -32,8 +34,15 @@ hashFile h file = CoProcess.query h send receive where send to = do fileEncoding to +#ifdef __WINDOWS__ + hSetNewlineMode to noNewlineTranslation +#endif hPutStrLn to file - receive from = getSha "hash-object" $ hGetLine from + receive from = getSha "hash-object" $ do +#ifdef __WINDOWS__ + hSetNewlineMode from noNewlineTranslation +#endif + hGetLine from {- Injects some content into git, returning its Sha. -} hashObject :: ObjectType -> String -> Repo -> IO Sha |