1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 18:36:27 +03:00

Don't set the handles to binary mode.

This commit is contained in:
Patrick Thomson 2019-09-29 18:57:35 -04:00
parent a686344145
commit d7b76d3be4

View File

@ -22,7 +22,6 @@ import Data.Char
import Data.Either (fromRight) import Data.Either (fromRight)
import Data.Text as Text import Data.Text as Text
import Shelly hiding (FilePath) import Shelly hiding (FilePath)
import System.IO (hSetBinaryMode)
-- | git clone --bare -- | git clone --bare
clone :: Text -> FilePath -> IO () clone :: Text -> FilePath -> IO ()
@ -39,7 +38,7 @@ lsTree :: FilePath -> OID -> IO [TreeEntry]
lsTree gitDir (OID sha) = sh $ parseEntries <$> run "git" ["-C", pack gitDir, "ls-tree", "-rz", sha] lsTree gitDir (OID sha) = sh $ parseEntries <$> run "git" ["-C", pack gitDir, "ls-tree", "-rz", sha]
sh :: MonadIO m => Sh a -> m a sh :: MonadIO m => Sh a -> m a
sh = shelly . silently . onCommandHandles (initOutputHandles (`hSetBinaryMode` True)) sh = shelly . silently
-- | Parses an list of entries separated by \NUL, and on failure return [] -- | Parses an list of entries separated by \NUL, and on failure return []
parseEntries :: Text -> [TreeEntry] parseEntries :: Text -> [TreeEntry]