close handles

This commit is contained in:
Joey Hess 2014-11-18 16:36:34 -04:00
parent efa5b12516
commit c008813bec
1 changed files with 8 additions and 4 deletions

View File

@ -325,10 +325,14 @@ gitPush hin hout = void $ fromstdin `concurrently` tostdout
connect fromh toh = do
b <- B.hGetSome fromh 40960
hPutStrLn stderr $ show ("from", fromh, "to", toh, b)
unless (B.null b) $ do
B.hPut toh b
hFlush toh
connect fromh toh
if B.null b
then do
hClose fromh
hClose toh
else do
B.hPut toh b
hFlush toh
connect fromh toh
hasOrigin :: IO Bool
hasOrigin = do