aboutsummaryrefslogtreecommitdiff
path: root/object/type/parse.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-29 11:13:33 +0000
committerGravatar Runxi Yu2026-03-29 11:13:33 +0000
commit301bb73dcad265af9c4b1028d7f33863c7b607d0 (patch)
treea4ad4af2ca7689e1f5cfbec90c05988d61154a7c /object/type/parse.go
parentobject/type, format/packfile: API cleanups (diff)
signatureNo signature
object/type: Use table structure v0.1.143
Diffstat (limited to 'object/type/parse.go')
-rw-r--r--object/type/parse.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/object/type/parse.go b/object/type/parse.go
new file mode 100644
index 00000000..bc5ca736
--- /dev/null
+++ b/object/type/parse.go
@@ -0,0 +1,8 @@
+package objecttype
+
+// Parse parses a canonical Git object type name.
+func Parse(name string) (Type, bool) {
+ ty, ok := typeByName[name]
+
+ return ty, ok
+}