ByteString Ref continued
Attoparsec parser for diff-tree. Changed fromRef back to producing a String, to avoid needing to convert every use of it. However, this does mean I'm going to miss some opportunities where fromRef is used and the result converted back to a ByteString. Would be worth revisiting that at some point maybe.
This commit is contained in:
parent
279991604d
commit
d5d8259937
12 changed files with 77 additions and 52 deletions
|
@ -96,7 +96,7 @@ parserLsTree = TreeItem
|
|||
<*> A8.takeTill (== ' ')
|
||||
<* A8.char ' '
|
||||
-- sha
|
||||
<*> (Ref . decodeBS' <$> A8.takeTill (== '\t'))
|
||||
<*> (Ref <$> A8.takeTill (== '\t'))
|
||||
<* A8.char '\t'
|
||||
-- file
|
||||
<*> (asTopFilePath . Git.Filename.decode <$> A.takeByteString)
|
||||
|
@ -106,6 +106,6 @@ formatLsTree :: TreeItem -> String
|
|||
formatLsTree ti = unwords
|
||||
[ showOct (mode ti) ""
|
||||
, decodeBS (typeobj ti)
|
||||
, decodeBS' (fromRef (sha ti))
|
||||
, fromRef (sha ti)
|
||||
, fromRawFilePath (getTopFilePath (file ti))
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue