convert Git.HashObject to use ByteStrings

Both lazy and strict, because sometimes it's more efficient to build a
small strict bytestring, and other times better to lazily stream.
This commit is contained in:
Joey Hess 2019-01-03 13:19:59 -04:00
parent 7d51b0c109
commit 53905490df
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 20 additions and 11 deletions

View file

@ -85,7 +85,7 @@ mergeFile info file hashhandle h = case filter (/= nullSha) [Ref asha, Ref bsha]
[] -> return Nothing
(sha:[]) -> use sha
shas -> use
=<< either return (\s -> hashBlob hashhandle (unlines s))
=<< either return (hashBlob hashhandle . encodeBS . unlines)
=<< calcMerge . zip shas <$> mapM getcontents shas
where
[_colonmode, _bmode, asha, bsha, _status] = words info