summaryrefslogtreecommitdiff
path: root/Git/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-21 20:07:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-21 20:07:44 -0400
commit9af412760354034678c901c45164c0066a4cd949 (patch)
tree5fbb0b27c8a6b96a991ef17dcc7cd9840d8539de /Git/Fsck.hs
parentc62c19e2283df2380c71e8ddcccd7194661c3b23 (diff)
merge from git-repair
Diffstat (limited to 'Git/Fsck.hs')
-rw-r--r--Git/Fsck.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Git/Fsck.hs b/Git/Fsck.hs
index 309f4bba5..8bfddb4ba 100644
--- a/Git/Fsck.hs
+++ b/Git/Fsck.hs
@@ -57,15 +57,14 @@ foundBroken (Just s) = not (S.null s)
{- Finds objects that are missing from the git repsitory, or are corrupt.
-
- This does not use git cat-file --batch, because catting a corrupt
- - object can cause it to crash, or to report incorrect size information.
+ - object can cause it to crash, or to report incorrect size information.a
-}
findMissing :: [Sha] -> Repo -> IO MissingObjects
-findMissing objs r = S.fromList <$> filterM (not <$$> cancat) objs
+findMissing objs r = S.fromList <$> filterM (not <$$> present) objs
where
- cancat o = either (const False) (const True) <$> tryIO (cat o)
- cat o = runQuiet
- [ Param "cat-file"
- , Param "-p"
+ present o = either (const False) (const True) <$> tryIO (dump o)
+ dump o = runQuiet
+ [ Param "show"
, Param (show o)
] r