summaryrefslogtreecommitdiff
path: root/Git/CatFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-20 15:23:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-20 15:23:06 -0400
commit66e2c6e3a16480e25f82ef447cfebac16997aac5 (patch)
tree16322a0c3555ec4e3120603537751502c3a764bd /Git/CatFile.hs
parentf78a4350eafb5c0e4b0b197f657df51a5231139b (diff)
remove workaround for bug in git 1.8.4r0
Diffstat (limited to 'Git/CatFile.hs')
-rw-r--r--Git/CatFile.hs27
1 files changed, 1 insertions, 26 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index f7438b410..2565dff94 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -73,10 +73,7 @@ catObjectDetails (CatFileHandle hdl repo) object = CoProcess.query hdl send rece
| otherwise -> dne
_
| header == show object ++ " missing" -> dne
- | otherwise ->
- if any isSpace query
- then fallback
- else error $ "unknown response from git cat-file " ++ show (header, object)
+ | otherwise -> error $ "unknown response from git cat-file " ++ show (header, object)
readcontent bytes from sha = do
content <- S.hGet from bytes
eatchar '\n' from
@@ -87,28 +84,6 @@ catObjectDetails (CatFileHandle hdl repo) object = CoProcess.query hdl send rece
when (c /= expected) $
error $ "missing " ++ (show expected) ++ " from git cat-file"
- {- Work around a bug in git 1.8.4 rc0 which broke it for filenames
- - containing spaces. http://bugs.debian.org/718517
- - Slow! Also can use a lot of memory, if the object is large. -}
- fallback = do
- let p = gitCreateProcess
- [ Param "cat-file"
- , Param "-p"
- , Param query
- ] repo
- (_, Just h, _, pid) <- withNullHandle $ \h ->
- createProcess p
- { std_out = CreatePipe
- , std_err = UseHandle h
- }
- fileEncoding h
- content <- L.hGetContents h
- let sha = (\s -> length s `seq` s) (show $ sha1 content)
- ok <- checkSuccessProcess pid
- return $ if ok
- then Just (content, Ref sha)
- else Nothing
-
{- Gets a list of files and directories in a tree. (Not recursive.) -}
catTree :: CatFileHandle -> Ref -> IO [(FilePath, FileMode)]
catTree h treeref = go <$> catObjectDetails h treeref