started converting Ref from String to ByteString
This should make code that reads shas and refs from git faster. Does not compile yet, a lot needs to be done still.
This commit is contained in:
parent
6e9714612b
commit
279991604d
17 changed files with 80 additions and 51 deletions
|
@ -81,11 +81,16 @@ pipeReadStrict' reader params repo = assertLocal repo $
|
|||
{- Runs a git command, feeding it an input, and returning its output,
|
||||
- which is expected to be fairly small, since it's all read into memory
|
||||
- strictly. -}
|
||||
pipeWriteRead :: [CommandParam] -> Maybe (Handle -> IO ()) -> Repo -> IO String
|
||||
pipeWriteRead :: [CommandParam] -> Maybe (Handle -> IO ()) -> Repo -> IO S.ByteString
|
||||
pipeWriteRead params writer repo = assertLocal repo $
|
||||
writeReadProcessEnv "git" (toCommand $ gitCommandLine params repo)
|
||||
(gitEnv repo) writer (Just adjusthandle)
|
||||
(gitEnv repo) writer'
|
||||
where
|
||||
writer' = case writer of
|
||||
Nothing -> Nothing
|
||||
Just a -> Just $ \h -> do
|
||||
adjusthandle h
|
||||
a h
|
||||
adjusthandle h = hSetNewlineMode h noNewlineTranslation
|
||||
|
||||
{- Runs a git command, feeding it input on a handle with an action. -}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue