summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-18 13:30:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-18 13:31:00 -0400
commit05310538ef4f2c0c483bab355083ec2044a12a0a (patch)
treec16d81764f760d82a3060e6a6f81f33cee87fae6 /Git
parent182526ff68b1ca68952b4dbd32121e46d4a80e85 (diff)
more debugging
Diffstat (limited to 'Git')
-rw-r--r--Git/CatFile.hs12
-rw-r--r--Git/CheckAttr.hs4
2 files changed, 15 insertions, 1 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index e667b2087..e8f362685 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -50,11 +50,16 @@ catObjectDetails :: CatFileHandle -> Ref -> IO (Maybe (L.ByteString, Sha))
catObjectDetails h object = CoProcess.query h send receive
where
send to = do
+ putStrLn "catObjectDetails send start"
fileEncoding to
hPutStrLn to $ show object
+ putStrLn $ "catObjectDetails send done " ++ show object
receive from = do
+ putStrLn "catObjectDetails read header start"
fileEncoding from
+ putStrLn "catObjectDetails read header start2"
header <- hGetLine from
+ putStrLn "catObjectDetails read header done"
case words header of
[sha, objtype, size]
| length sha == shaSize &&
@@ -67,9 +72,14 @@ catObjectDetails h object = CoProcess.query h send receive
| header == show object ++ " missing" -> dne
| otherwise -> error $ "unknown response from git cat-file " ++ show (header, object)
readcontent bytes from sha = do
+ putStrLn "readcontent start"
content <- S.hGet from bytes
+ putStrLn "readcontent end"
c <- hGetChar from
+ putStrLn "readcontent newline read"
when (c /= '\n') $
error "missing newline from git cat-file"
return $ Just (L.fromChunks [content], Ref sha)
- dne = return Nothing
+ dne = do
+ putStrLn "dne"
+ return Nothing
diff --git a/Git/CheckAttr.hs b/Git/CheckAttr.hs
index 6b321f8b8..7636ea641 100644
--- a/Git/CheckAttr.hs
+++ b/Git/CheckAttr.hs
@@ -44,11 +44,15 @@ checkAttr (h, attrs, cwd) want file = do
_ -> error $ "unable to determine " ++ want ++ " attribute of " ++ file
where
send to = do
+ putStrLn "checkAttr send start"
fileEncoding to
hPutStr to $ file' ++ "\0"
+ putStrLn "checkAttr send end"
receive from = forM attrs $ \attr -> do
+ putStrLn "checkAttr receive start"
fileEncoding from
l <- hGetLine from
+ putStrLn "checkAttr receive end"
return (attr, attrvalue attr l)
{- Before git 1.7.7, git check-attr worked best with
- absolute filenames; using them worked around some bugs