summaryrefslogtreecommitdiff
path: root/Git/LsTree.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/LsTree.hs')
-rw-r--r--Git/LsTree.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Git/LsTree.hs b/Git/LsTree.hs
index dc03b8896..64187b89b 100644
--- a/Git/LsTree.hs
+++ b/Git/LsTree.hs
@@ -8,6 +8,7 @@
module Git.LsTree (
TreeItem(..),
lsTree,
+ lsTreeFiles,
parseLsTree
) where
@@ -27,11 +28,16 @@ data TreeItem = TreeItem
, file :: FilePath
} deriving Show
-{- Lists the contents of a Ref -}
+{- Lists the complete contents of a tree. -}
lsTree :: Ref -> Repo -> IO [TreeItem]
lsTree t repo = map parseLsTree <$>
pipeNullSplitZombie [Params "ls-tree --full-tree -z -r --", File $ show t] repo
+{- Lists specified files in a tree. -}
+lsTreeFiles :: Ref -> [FilePath] -> Repo -> IO [TreeItem]
+lsTreeFiles t fs repo = map parseLsTree <$>
+ pipeNullSplitZombie ([Params "ls-tree -z --", File $ show t] ++ map File fs) repo
+
{- Parses a line of ls-tree output.
- (The --long format is not currently supported.) -}
parseLsTree :: String -> TreeItem