more RawFilePath conversion
at 377/645 This commit was sponsored by Svenne Krap on Patreon.
This commit is contained in:
parent
f45ad178cb
commit
681b44236a
23 changed files with 215 additions and 188 deletions
|
@ -45,11 +45,11 @@ data Action m
|
|||
- to as the queue grows. -}
|
||||
| InternalAction
|
||||
{ getRunner :: InternalActionRunner m
|
||||
, getInternalFiles :: [(FilePath, IO Bool)]
|
||||
, getInternalFiles :: [(RawFilePath, IO Bool)]
|
||||
}
|
||||
|
||||
{- The String must be unique for each internal action. -}
|
||||
data InternalActionRunner m = InternalActionRunner String (Repo -> [(FilePath, IO Bool)] -> m ())
|
||||
data InternalActionRunner m = InternalActionRunner String (Repo -> [(RawFilePath, IO Bool)] -> m ())
|
||||
|
||||
instance Eq (InternalActionRunner m) where
|
||||
InternalActionRunner s1 _ == InternalActionRunner s2 _ = s1 == s2
|
||||
|
@ -108,7 +108,7 @@ addCommand subcommand params files q repo =
|
|||
different _ = True
|
||||
|
||||
{- Adds an internal action to the queue. -}
|
||||
addInternalAction :: MonadIO m => InternalActionRunner m -> [(FilePath, IO Bool)] -> Queue m -> Repo -> m (Queue m)
|
||||
addInternalAction :: MonadIO m => InternalActionRunner m -> [(RawFilePath, IO Bool)] -> Queue m -> Repo -> m (Queue m)
|
||||
addInternalAction runner files q repo =
|
||||
updateQueue action different (length files) q repo
|
||||
where
|
||||
|
|
|
@ -31,6 +31,7 @@ import Git.FilePath
|
|||
import Git.Sha
|
||||
import qualified Git.DiffTreeItem as Diff
|
||||
|
||||
import qualified Data.ByteString as S
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
import Control.Monad.IO.Class
|
||||
|
||||
|
@ -135,7 +136,7 @@ indexPath :: TopFilePath -> InternalGitPath
|
|||
indexPath = toInternalGitPath . getTopFilePath
|
||||
|
||||
{- Refreshes the index, by checking file stat information. -}
|
||||
refreshIndex :: Repo -> ((FilePath -> IO ()) -> IO ()) -> IO Bool
|
||||
refreshIndex :: Repo -> ((RawFilePath -> IO ()) -> IO ()) -> IO Bool
|
||||
refreshIndex repo feeder = withCreateProcess p go
|
||||
where
|
||||
params =
|
||||
|
@ -150,9 +151,8 @@ refreshIndex repo feeder = withCreateProcess p go
|
|||
{ std_in = CreatePipe }
|
||||
|
||||
go (Just h) _ _ pid = do
|
||||
feeder $ \f -> do
|
||||
hPutStr h f
|
||||
hPutStr h "\0"
|
||||
feeder $ \f ->
|
||||
S.hPut h (S.snoc f 0)
|
||||
hFlush h
|
||||
hClose h
|
||||
checkSuccessProcess pid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue