avoid newline translation when writing to git hash-object

They're like mushrooms, just keep popping up.
This commit is contained in:
Joey Hess 2013-06-18 14:58:38 -04:00
parent 02c51266ec
commit 4e2fab90d5
2 changed files with 7 additions and 1 deletions

View file

@ -78,7 +78,11 @@ pipeReadStrict params repo = assertLocal repo $
pipeWriteRead :: [CommandParam] -> String -> Repo -> IO String
pipeWriteRead params s repo = assertLocal repo $
writeReadProcessEnv "git" (toCommand $ gitCommandLine params repo)
(gitEnv repo) s (Just fileEncoding)
(gitEnv repo) s (Just adjusthandle)
where
adjusthandle h = do
fileEncoding h
hSetNewlineMode h noNewlineTranslation
{- Runs a git command, feeding it input on a handle with an action. -}
pipeWrite :: [CommandParam] -> Repo -> (Handle -> IO ()) -> IO ()