aboutsummaryrefslogtreecommitdiff
path: root/object/id/object_format_parse.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-05-24 11:07:16 +0000
committerGravatar Runxi Yu2026-05-24 11:09:59 +0000
commit36340918040627d93808c09dea8d9bd7b7457f82 (patch)
treedab5fa0edbf2f2bf315d1fda73c0f7ac5c8fc6d9 /object/id/object_format_parse.go
parentinternal/testgit: Add Algorithm method (diff)
signatureNo signature
object/id: Rename algorithm to object format
Diffstat (limited to 'object/id/object_format_parse.go')
-rw-r--r--object/id/object_format_parse.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/object/id/object_format_parse.go b/object/id/object_format_parse.go
new file mode 100644
index 00000000..9e7401c7
--- /dev/null
+++ b/object/id/object_format_parse.go
@@ -0,0 +1,8 @@
+package id
+
+// ParseObjectFormat parses a canonical object format name (e.g. "sha1", "sha256").
+func ParseObjectFormat(s string) (ObjectFormat, bool) {
+ objectFormat, ok := objectFormatByName[s]
+
+ return objectFormat, ok
+}