diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-06 02:31:31 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-06 02:31:31 -0400 |
commit | f596084a599fb363dcbb425dce7c4ca46bb56ca0 (patch) | |
tree | 934e14858c9f56cf9f69cb7eadfadee4a8b4c1eb /Git/CatFile.hs | |
parent | f1bd72ea546be705334ba8f6d01d9dcfb0c33cf9 (diff) |
move hashObject to HashObject library and generalize it to support all git object types
Diffstat (limited to 'Git/CatFile.hs')
-rw-r--r-- | Git/CatFile.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs index c598d7aa4..d5b367945 100644 --- a/Git/CatFile.hs +++ b/Git/CatFile.hs @@ -21,6 +21,7 @@ import Common import Git import Git.Sha import Git.Command +import Git.Types import qualified Utility.CoProcess as CoProcess type CatFileHandle = CoProcess.CoProcessHandle @@ -52,7 +53,7 @@ catObject h object = CoProcess.query h send receive case words header of [sha, objtype, size] | length sha == shaSize && - validobjtype objtype -> + isJust (readObjectType objtype) -> case reads size of [(bytes, "")] -> readcontent bytes from _ -> dne @@ -67,8 +68,3 @@ catObject h object = CoProcess.query h send receive error "missing newline from git cat-file" return $ L.fromChunks [content] dne = return L.empty - validobjtype t - | t == "blob" = True - | t == "commit" = True - | t == "tree" = True - | otherwise = False |