aboutsummaryrefslogtreecommitdiff
path: root/object/id/object_format.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.go
parentinternal/testgit: Add Algorithm method (diff)
signatureNo signature
object/id: Rename algorithm to object format
Diffstat (limited to 'object/id/object_format.go')
-rw-r--r--object/id/object_format.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/object/id/object_format.go b/object/id/object_format.go
new file mode 100644
index 00000000..c21e8fa7
--- /dev/null
+++ b/object/id/object_format.go
@@ -0,0 +1,25 @@
+package id
+
+// ObjectFormat identifies the Git object format,
+// i.e., the hash algorithm used in git object IDs.
+type ObjectFormat uint8
+
+const (
+ // ObjectFormatUnknown identifies an unknown object format.
+ ObjectFormatUnknown ObjectFormat = iota
+
+ // ObjectFormatSHA1 identifies the SHA-1 object format.
+ // This is the default for all versions of Git until Git 3.0.
+ ObjectFormatSHA1
+
+ // ObjectFormatSHA256 identifies the SHA-256 object format.
+ // This is the default for Git 3.0 and beyond.
+ ObjectFormatSHA256
+)
+
+// SupportedObjectFormats returns all object formats supported by furgit.
+//
+// Labels: Mut-No.
+func SupportedObjectFormats() []ObjectFormat {
+ return supportedObjectFormats
+}