summaryrefslogtreecommitdiff
path: root/Git/Fsck.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Fsck.hs')
-rw-r--r--Git/Fsck.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Git/Fsck.hs b/Git/Fsck.hs
index a43a84f3e..5fdc73385 100644
--- a/Git/Fsck.hs
+++ b/Git/Fsck.hs
@@ -7,7 +7,8 @@
module Git.Fsck (
findBroken,
- findMissing
+ findMissing,
+ MissingObjects
) where
import Common
@@ -18,6 +19,8 @@ import Git.CatFile
import qualified Data.Set as S
+type MissingObjects = S.Set Sha
+
{- Runs fsck to find some of the broken objects in the repository.
- May not find all broken objects, if fsck fails on bad data in some of
- the broken objects it does find. If the fsck fails generally without
@@ -28,7 +31,7 @@ import qualified Data.Set as S
- to be a git sha. Not all such shas are of broken objects, so ask git
- to try to cat the object, and see if it fails.
-}
-findBroken :: Repo -> IO (Maybe (S.Set Sha))
+findBroken :: Repo -> IO (Maybe MissingObjects)
findBroken r = do
(output, fsckok) <- processTranscript "git" (toCommand $ fsckParams r) Nothing
let objs = parseFsckOutput output
@@ -39,7 +42,7 @@ findBroken r = do
{- Finds objects that are missing from the git repsitory, or are corrupt.
- Note that catting a corrupt object will cause cat-file to crash. -}
-findMissing :: [Sha] -> Repo -> IO (S.Set Sha)
+findMissing :: [Sha] -> Repo -> IO MissingObjects
findMissing objs r = go objs [] =<< start
where
start = catFileStart' False r