summaryrefslogtreecommitdiff
path: root/Git/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Types.hs')
-rw-r--r--Git/Types.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Git/Types.hs b/Git/Types.hs
index 1df6e343b..e8cdbb442 100644
--- a/Git/Types.hs
+++ b/Git/Types.hs
@@ -71,3 +71,9 @@ instance Show BlobType where
show FileBlob = "100644"
show ExecutableBlob = "100755"
show SymlinkBlob = "120000"
+
+readBlobType :: String -> Maybe BlobType
+readBlobType "100644" = Just FileBlob
+readBlobType "100755" = Just ExecutableBlob
+readBlobType "120000" = Just SymlinkBlob
+readBlobType _ = Nothing