better name
This commit is contained in:
parent
2bb6b02948
commit
272a67921c
2 changed files with 7 additions and 7 deletions
|
@ -56,7 +56,7 @@ index g = gitAnnexDir g </> "index"
|
||||||
- and merge in changes from other branches.
|
- and merge in changes from other branches.
|
||||||
-}
|
-}
|
||||||
genIndex :: Git.Repo -> IO ()
|
genIndex :: Git.Repo -> IO ()
|
||||||
genIndex g = Git.UnionMerge.update_index_via g
|
genIndex g = Git.UnionMerge.stream_update_index g
|
||||||
[Git.UnionMerge.ls_tree fullname g]
|
[Git.UnionMerge.ls_tree fullname g]
|
||||||
|
|
||||||
{- Runs an action using the branch's index file. -}
|
{- Runs an action using the branch's index file. -}
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Git.UnionMerge (
|
||||||
merge,
|
merge,
|
||||||
merge_index,
|
merge_index,
|
||||||
update_index,
|
update_index,
|
||||||
update_index_via,
|
stream_update_index,
|
||||||
update_index_line,
|
update_index_line,
|
||||||
ls_tree
|
ls_tree
|
||||||
) where
|
) where
|
||||||
|
@ -30,7 +30,7 @@ import Git.CatFile
|
||||||
merge :: String -> String -> Repo -> IO ()
|
merge :: String -> String -> Repo -> IO ()
|
||||||
merge x y repo = do
|
merge x y repo = do
|
||||||
h <- catFileStart repo
|
h <- catFileStart repo
|
||||||
update_index_via repo
|
stream_update_index repo
|
||||||
[ ls_tree x repo
|
[ ls_tree x repo
|
||||||
, merge_trees x y h repo
|
, merge_trees x y h repo
|
||||||
]
|
]
|
||||||
|
@ -40,19 +40,19 @@ merge x y repo = do
|
||||||
- the index are preserved (and participate in the merge). -}
|
- the index are preserved (and participate in the merge). -}
|
||||||
merge_index :: CatFileHandle -> Repo -> [String] -> IO ()
|
merge_index :: CatFileHandle -> Repo -> [String] -> IO ()
|
||||||
merge_index h repo bs =
|
merge_index h repo bs =
|
||||||
update_index_via repo $ map (\b -> merge_tree_index b h repo) bs
|
stream_update_index repo $ map (\b -> merge_tree_index b h repo) bs
|
||||||
|
|
||||||
{- Feeds content into update-index. Later items in the list can override
|
{- Feeds content into update-index. Later items in the list can override
|
||||||
- earlier ones, so the list can be generated from any combination of
|
- earlier ones, so the list can be generated from any combination of
|
||||||
- ls_tree, merge_trees, and merge_tree_index. -}
|
- ls_tree, merge_trees, and merge_tree_index. -}
|
||||||
update_index :: Repo -> [String] -> IO ()
|
update_index :: Repo -> [String] -> IO ()
|
||||||
update_index repo ls = update_index_via repo [\s -> mapM_ s ls]
|
update_index repo ls = stream_update_index repo [\s -> mapM_ s ls]
|
||||||
|
|
||||||
type Streamer = (String -> IO ()) -> IO ()
|
type Streamer = (String -> IO ()) -> IO ()
|
||||||
|
|
||||||
{- Streams content into update-index. -}
|
{- Streams content into update-index. -}
|
||||||
update_index_via :: Repo -> [Streamer] -> IO ()
|
stream_update_index :: Repo -> [Streamer] -> IO ()
|
||||||
update_index_via repo as = do
|
stream_update_index repo as = do
|
||||||
(p, h) <- hPipeTo "git" (toCommand $ Git.gitCommandLine params repo)
|
(p, h) <- hPipeTo "git" (toCommand $ Git.gitCommandLine params repo)
|
||||||
forM_ as (stream h)
|
forM_ as (stream h)
|
||||||
hClose h
|
hClose h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue