summaryrefslogtreecommitdiff
path: root/Git/CatFile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/CatFile.hs')
-rw-r--r--Git/CatFile.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index 2cef9d5b3..16f0b11b9 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -19,10 +19,10 @@ import System.IO
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.Lazy.Char8 as L
+import Common
import Git
import Git.Sha
import Git.Command
-import Utility.SafeCommand
type CatFileHandle = (PipeHandle, Handle, Handle)
@@ -53,21 +53,21 @@ catObject (_, from, to) object = do
[sha, objtype, size]
| length sha == shaSize &&
validobjtype objtype -> handle size
- | otherwise -> empty
+ | otherwise -> dne
_
- | header == show object ++ " missing" -> empty
+ | header == show object ++ " missing" -> dne
| otherwise -> error $ "unknown response from git cat-file " ++ header
where
handle size = case reads size of
[(bytes, "")] -> readcontent bytes
- _ -> empty
+ _ -> dne
readcontent bytes = do
content <- S.hGet from bytes
c <- hGetChar from
when (c /= '\n') $
error "missing newline from git cat-file"
return $ L.fromChunks [content]
- empty = return L.empty
+ dne = return L.empty
validobjtype t
| t == "blob" = True
| t == "commit" = True