split more stuff out of Git.hs
This commit is contained in:
parent
2b24e16a63
commit
02f1bd2bf4
20 changed files with 197 additions and 179 deletions
|
@ -20,6 +20,7 @@ import qualified Data.Set as S
|
|||
|
||||
import Common
|
||||
import Git
|
||||
import Git.Sha
|
||||
import Git.CatFile
|
||||
|
||||
type Streamer = (String -> IO ()) -> IO ()
|
||||
|
@ -27,7 +28,7 @@ type Streamer = (String -> IO ()) -> IO ()
|
|||
{- Performs a union merge between two branches, staging it in the index.
|
||||
- Any previously staged changes in the index will be lost.
|
||||
-
|
||||
- Should be run with a temporary index file configured by Git.useIndex.
|
||||
- Should be run with a temporary index file configured by useIndex.
|
||||
-}
|
||||
merge :: Ref -> Ref -> Repo -> IO ()
|
||||
merge x y repo = do
|
||||
|
@ -53,7 +54,7 @@ update_index repo ls = stream_update_index repo [(`mapM_` ls)]
|
|||
{- Streams content into update-index. -}
|
||||
stream_update_index :: Repo -> [Streamer] -> IO ()
|
||||
stream_update_index repo as = do
|
||||
(p, h) <- hPipeTo "git" (toCommand $ Git.gitCommandLine params repo)
|
||||
(p, h) <- hPipeTo "git" (toCommand $ gitCommandLine params repo)
|
||||
forM_ as (stream h)
|
||||
hClose h
|
||||
forceSuccess p
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue