implemented removal of corrupt tracking branches

Oh, git, you made this so hard. Not determining if a branch pointed to some
corrupt object, that was easy, but dealing with corrupt branches using git
plumbing is a PITA.
This commit is contained in:
Joey Hess 2013-10-21 15:28:06 -04:00
parent 6d8250c255
commit fcd91be6f0
5 changed files with 195 additions and 24 deletions

View file

@ -8,6 +8,7 @@
module Git.LsTree (
TreeItem(..),
lsTree,
lsTreeParams,
lsTreeFiles,
parseLsTree
) where
@ -33,9 +34,11 @@ data TreeItem = TreeItem
{- Lists the complete contents of a tree, recursing into sub-trees,
- with lazy output. -}
lsTree :: Ref -> Repo -> IO [TreeItem]
lsTree t repo = map parseLsTree <$> pipeNullSplitZombie ps repo
where
ps = [Params "ls-tree --full-tree -z -r --", File $ show t]
lsTree t repo = map parseLsTree
<$> pipeNullSplitZombie (lsTreeParams t) repo
lsTreeParams :: Ref -> [CommandParam]
lsTreeParams t = [ Params "ls-tree --full-tree -z -r --", File $ show t ]
{- Lists specified files in a tree. -}
lsTreeFiles :: Ref -> [FilePath] -> Repo -> IO [TreeItem]