Fix querying git for object type when operating on a file containing newlines

This typo would make "git cat-file cat-file" fail, and the way it's used,
I think it broke querying all info from filenames containing newlines,
because the other queries are only run when it succeeds.
This commit is contained in:
Joey Hess 2019-08-07 13:35:42 -04:00
parent ed6ed2e915
commit bf5dd723d3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 1 deletions

View file

@ -182,7 +182,7 @@ querySize r repo = maybe Nothing (readMaybe . takeWhile (/= '\n'))
queryObjectType :: Ref -> Repo -> IO (Maybe ObjectType)
queryObjectType r repo = maybe Nothing (readObjectType . takeWhile (/= '\n'))
<$> querySingle (Param "cat-file") r repo hGetContentsStrict
<$> querySingle (Param "-t") r repo hGetContentsStrict
queryContent :: Ref -> Repo -> IO (Maybe L.ByteString)
queryContent r repo = fmap (\b -> L.fromChunks [b])