summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-31 17:12:01 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-31 17:12:01 -0400
commite4d26871077f5a9af3445dc2f88fd743851db53d (patch)
treec56e57ca0e2ed0bd152c2592bf34ebccedebf8e6 /Git
parent6318e53fb1dc8e60952427170cf0c16b86c20276 (diff)
fix parsing of commit with no parents
Diffstat (limited to 'Git')
-rw-r--r--Git/CatFile.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index d6f7707bc..dc96730ab 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -125,7 +125,7 @@ catCommit h commitref = go <$> catObjectDetails h commitref
parseCommit :: L.ByteString -> Maybe Commit
parseCommit b = Commit
<$> (extractSha . L8.unpack =<< field "tree")
- <*> (mapMaybe (extractSha . L8.unpack) <$> fields "parent")
+ <*> Just (maybe [] (mapMaybe (extractSha . L8.unpack)) (fields "parent"))
<*> (parsemetadata <$> field "author")
<*> (parsemetadata <$> field "committer")
<*> Just (L8.unpack $ L.intercalate (L.singleton nl) message)