@@ -67,7 +67,6 @@ import Control.Monad.Catch
67
67
import Control.Monad.Loops
68
68
import Control.Monad.Trans.Reader (ReaderT , runReaderT , ask )
69
69
import Control.Monad.Trans.Resource
70
- import Control.Monad.IO.Unlift
71
70
import Data.Bits ((.|.) , (.&.) )
72
71
import Data.Bool (bool )
73
72
import Data.ByteString (ByteString )
@@ -103,9 +102,8 @@ import Foreign.Storable
103
102
import qualified Git
104
103
import Git.Libgit2.Internal
105
104
import Git.Libgit2.Types
106
- import Language.Haskell.TH.Syntax (Loc (.. ))
107
105
108
- import Prelude hiding (mapM , mapM_ , sequence , catch )
106
+ import Prelude hiding (mapM , mapM_ , sequence )
109
107
import System.Directory
110
108
import System.FilePath.Posix
111
109
import System.IO (openBinaryTempFile , hClose )
@@ -351,7 +349,7 @@ lgTreeOid (LgTree (Just tree)) = liftIO $ do
351
349
gatherFrom' :: (MonadExcept m , MonadUnliftIO m )
352
350
=> Int -- ^ Size of the queue to create
353
351
-> (TBQueue o -> m () ) -- ^ Action that generates output values
354
- -> Producer m o
352
+ -> ConduitT i o m ()
355
353
gatherFrom' size scatter = do
356
354
chan <- liftIO $ newTBQueueIO (fromIntegral size)
357
355
worker <- lift $ async (scatter chan)
@@ -371,7 +369,7 @@ gatherFrom' size scatter = do
371
369
lgSourceTreeEntries
372
370
:: (MonadLg m , HasLgRepo m )
373
371
=> Tree
374
- -> Producer m (Git. TreeFilePath , TreeEntry )
372
+ -> ConduitT i (Git. TreeFilePath , TreeEntry ) m ( )
375
373
lgSourceTreeEntries (LgTree Nothing ) = return ()
376
374
lgSourceTreeEntries (LgTree (Just tree)) = gatherFrom' 16 $ \ queue -> do
377
375
liftIO $ withForeignPtr tree $ \ tr -> do
@@ -708,7 +706,7 @@ lgForEachObject odbPtr f payload =
708
706
709
707
lgSourceObjects :: (MonadLg m , HasLgRepo m )
710
708
=> Maybe CommitOid -> CommitOid -> Bool
711
- -> Producer m ObjectOid
709
+ -> ConduitT i ObjectOid m ()
712
710
lgSourceObjects mhave need alsoTrees = do
713
711
repo <- lift getRepository
714
712
walker <- liftIO $ alloca $ \ pptr -> do
@@ -940,7 +938,7 @@ flagsToInt flags = (if listFlagOid flags then 1 else 0)
940
938
+ (if listFlagHasPeel flags then 8 else 0 )
941
939
942
940
943
- lgSourceRefs :: (MonadLg m , HasLgRepo m ) => Producer m Git. RefName
941
+ lgSourceRefs :: (MonadLg m , HasLgRepo m ) => ConduitT i Git. RefName m ()
944
942
lgSourceRefs =
945
943
gatherFrom' 16 $ \ queue -> do
946
944
repo <- getRepository
@@ -1033,10 +1031,11 @@ lgThrow f = do
1033
1031
1034
1032
lgDiffContentsWithTree
1035
1033
:: MonadLg m
1036
- => Source ( ReaderT LgRepo m )
1034
+ => ConduitM ( )
1037
1035
(Either Git. TreeFilePath (Either Git. SHA ByteString ))
1036
+ (ReaderT LgRepo m ) ()
1038
1037
-> Tree
1039
- -> Producer (ReaderT LgRepo m ) ByteString
1038
+ -> ConduitT i ByteString (ReaderT LgRepo m ) ()
1040
1039
lgDiffContentsWithTree _contents (LgTree Nothing ) =
1041
1040
liftIO $ throwM $
1042
1041
Git. DiffTreeToIndexFailed " Cannot diff against an empty tree"
0 commit comments