split more stuff out of Git.hs

This commit is contained in:
Joey Hess 2011-12-14 15:30:14 -04:00
parent 2b24e16a63
commit 02f1bd2bf4
20 changed files with 197 additions and 179 deletions

View file

@ -17,10 +17,10 @@ hashFiles paths repo = do
(pid, fromh, toh) <- hPipeBoth "git" $ toCommand $ git_hash_object repo
_ <- forkProcess (feeder toh)
hClose toh
shas <- map Git.Ref . lines <$> hGetContentsStrict fromh
shas <- map Ref . lines <$> hGetContentsStrict fromh
return (shas, ender fromh pid)
where
git_hash_object = Git.gitCommandLine
git_hash_object = gitCommandLine
[Param "hash-object", Param "-w", Param "--stdin-paths"]
feeder toh = do
hPutStr toh $ unlines paths