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
|
@ -12,16 +12,19 @@ import Git
|
|||
import Git.Command
|
||||
import Git.Sha
|
||||
|
||||
import qualified Data.ByteString as S
|
||||
import qualified Data.ByteString.Char8 as S8
|
||||
|
||||
{- Gets the reflog for a given branch. -}
|
||||
get :: Branch -> Repo -> IO [Sha]
|
||||
get b = getMulti [b]
|
||||
|
||||
{- Gets reflogs for multiple branches. -}
|
||||
getMulti :: [Branch] -> Repo -> IO [Sha]
|
||||
getMulti bs = get' (map (Param . fromRef) bs)
|
||||
getMulti bs = get' (map (Param . decodeBS' . fromRef) bs)
|
||||
|
||||
get' :: [CommandParam] -> Repo -> IO [Sha]
|
||||
get' ps = mapMaybe extractSha . lines . decodeBS <$$> pipeReadStrict ps'
|
||||
get' ps = mapMaybe (extractSha . S.copy) . S8.lines <$$> pipeReadStrict ps'
|
||||
where
|
||||
ps' = catMaybes
|
||||
[ Just $ Param "log"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue