aboutsummaryrefslogtreecommitdiff
path: root/object/parse_without_header.go
diff options
context:
space:
mode:
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)
- }
-}