another place hGetBoth was used without a writer thread

This commit is contained in:
Joey Hess 2012-02-13 20:23:45 -04:00
parent cad8824852
commit d35a8d85b5

View file

@ -9,6 +9,8 @@ module Git.Command where
import qualified Data.Text.Lazy as L import qualified Data.Text.Lazy as L
import qualified Data.Text.Lazy.IO as L import qualified Data.Text.Lazy.IO as L
import Control.Concurrent
import Control.Exception (finally)
import Common import Common
import Git import Git
@ -61,8 +63,7 @@ pipeWriteRead params s repo = assertLocal repo $ do
(p, from, to) <- hPipeBoth "git" (toCommand $ gitCommandLine params repo) (p, from, to) <- hPipeBoth "git" (toCommand $ gitCommandLine params repo)
fileEncoding to fileEncoding to
fileEncoding from fileEncoding from
hPutStr to s _ <- forkIO $ finally (hPutStr to s) (hClose to)
hClose to
c <- hGetContents from c <- hGetContents from
return (p, c) return (p, c)