summaryrefslogtreecommitdiff
path: root/Git/LsTree.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-29 22:31:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-29 22:31:20 -0400
commit949ef94d5e5583e55d6ba9797cf71177b252173d (patch)
treed76fbb8e9f889f484a9cdbd353fa56468b5fa7c7 /Git/LsTree.hs
parent4050c24d7bc49345b914bc062c0a5aedb93cfc8d (diff)
layout
Diffstat (limited to 'Git/LsTree.hs')
-rw-r--r--Git/LsTree.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Git/LsTree.hs b/Git/LsTree.hs
index 9d2fe7a37..e0aa5a443 100644
--- a/Git/LsTree.hs
+++ b/Git/LsTree.hs
@@ -36,11 +36,12 @@ lsTree repo t = map parseLsTree <$>
{- Parses a line of ls-tree output.
- (The --long format is not currently supported.) -}
parseLsTree :: L.ByteString -> TreeItem
-parseLsTree l = TreeItem
- (fst $ head $ readOct $ L.unpack m)
- (L.unpack t)
- (L.unpack s)
- (decodeGitFile $ L.unpack f)
+parseLsTree l = TreeItem
+ { mode = fst $ head $ readOct $ L.unpack m
+ , typeobj = L.unpack t
+ , sha = L.unpack s
+ , file = decodeGitFile $ L.unpack f
+ }
where
-- l = <mode> SP <type> SP <sha> TAB <file>
-- All fields are fixed, so we can pull them out of