From 11935c4d6f93146084111fee3f97cb4667f4f618 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 31 Mar 2016 17:12:01 -0400 Subject: [PATCH] fix parsing of commit with no parents --- Git/CatFile.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git/CatFile.hs b/Git/CatFile.hs index d6f7707bca..dc96730ab6 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)