aboutsummaryrefslogtreecommitdiff
path: root/object/parse_without_header.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 06:23:30 +0000
committerGravatar Runxi Yu2026-04-02 06:28:39 +0000
commita041d523de389b65b98a5373a8034041db2a8d83 (patch)
tree7b423dc735f463be616045f2c3c2095a7737aca7 /object/parse_without_header.go
parentresearch: Add dynamic pack resources (diff)
signatureNo signature
*: Remove
Diffstat (limited to 'object/parse_without_header.go')
-rw-r--r--object/parse_without_header.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/object/parse_without_header.go b/object/parse_without_header.go
deleted file mode 100644
index c889cb40..00000000
--- a/object/parse_without_header.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package object
-
-import (
- "fmt"
-
- "codeberg.org/lindenii/furgit/object/blob"
- "codeberg.org/lindenii/furgit/object/commit"
- objectid "codeberg.org/lindenii/furgit/object/id"
- "codeberg.org/lindenii/furgit/object/tag"
- "codeberg.org/lindenii/furgit/object/tree"
- objecttype "codeberg.org/lindenii/furgit/object/type"
-)
-
-// ParseWithoutHeader parses a typed object body.
-//
-//nolint:ireturn
-func ParseWithoutHeader(ty objecttype.Type, body []byte, algo objectid.Algorithm) (Object, error) {
- switch ty {
- case objecttype.TypeBlob:
- return blob.Parse(body)
- case objecttype.TypeTree:
- return tree.Parse(body, algo)
- case objecttype.TypeCommit:
- return commit.Parse(body, algo)
- case objecttype.TypeTag:
- return tag.Parse(body, algo)
- case objecttype.TypeInvalid, objecttype.TypeFuture, objecttype.TypeOfsDelta, objecttype.TypeRefDelta:
- return nil, fmt.Errorf("object: unsupported object type %d", ty)
- default:
- return nil, fmt.Errorf("object: unsupported object type %d", ty)
- }
-}