diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-20 17:50:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-20 17:50:51 -0400 |
commit | 66ccc37a99994f1206d308c0c0003ac2605d3c42 (patch) | |
tree | 17fd97ca91a7c963cf80ac1274c94ac841e8572c /Git/HashObject.hs | |
parent | 66e2c6e3a16480e25f82ef447cfebac16997aac5 (diff) |
git-recover-repository 1/2 done
Diffstat (limited to 'Git/HashObject.hs')
-rw-r--r-- | Git/HashObject.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Git/HashObject.hs b/Git/HashObject.hs index c6e1d2349..bb9b20d96 100644 --- a/Git/HashObject.hs +++ b/Git/HashObject.hs @@ -36,8 +36,11 @@ hashFile h file = CoProcess.query h send receive {- Injects some content into git, returning its Sha. -} hashObject :: ObjectType -> String -> Repo -> IO Sha -hashObject objtype content repo = getSha subcmd $ - pipeWriteRead (map Param params) content repo +hashObject objtype content = hashObject' objtype (flip hPutStr content) + +hashObject' :: ObjectType -> (Handle -> IO ()) -> Repo -> IO Sha +hashObject' objtype writer repo = getSha subcmd $ + pipeWriteRead (map Param params) (Just writer) repo where subcmd = "hash-object" params = [subcmd, "-t", show objtype, "-w", "--stdin", "--no-filters"] |