aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--object/typ/type.go17
-rw-r--r--object/typ/type_details.go16
-rw-r--r--object/typ/type_ops.go8
3 files changed, 6 insertions, 35 deletions
diff --git a/object/typ/type.go b/object/typ/type.go
index 69a07de3..5f7decc1 100644
--- a/object/typ/type.go
+++ b/object/typ/type.go
@@ -1,10 +1,6 @@
package typ
// Type represents a Git object type.
-//
-// The values currently mirror what's found in the Git packfile format.
-//
-// TODO: Revisit this.
type Type uint8
const (
@@ -22,17 +18,4 @@ const (
// TypeTag represents a Git tag.
TypeTag Type = 4
-
- // TypeFuture is reserved for the future, just like in the packfile format.
- TypeFuture Type = 5
-
- // TypeOfsDelta is reserved for internal use in packfile handlers.
- //
- // TODO: Revisit this.
- TypeOfsDelta Type = 6
-
- // TypeRefDelta is reserved for internal use in packfile handlers.
- //
- // TODO: Revisit this.
- TypeRefDelta Type = 7
)
diff --git a/object/typ/type_details.go b/object/typ/type_details.go
index 48dcf829..ebe1bbbe 100644
--- a/object/typ/type_details.go
+++ b/object/typ/type_details.go
@@ -1,8 +1,7 @@
package typ
type typeDetails struct {
- name string
- isBaseObject bool
+ name string
}
func (ty Type) details() typeDetails {
@@ -11,14 +10,11 @@ func (ty Type) details() typeDetails {
//nolint:gochecknoglobals
var typeTable = [...]typeDetails{
- TypeInvalid: {name: "", isBaseObject: false},
- TypeCommit: {name: "commit", isBaseObject: true},
- TypeTree: {name: "tree", isBaseObject: true},
- TypeBlob: {name: "blob", isBaseObject: true},
- TypeTag: {name: "tag", isBaseObject: true},
- TypeFuture: {name: "", isBaseObject: false},
- TypeOfsDelta: {name: "", isBaseObject: false},
- TypeRefDelta: {name: "", isBaseObject: false},
+ TypeInvalid: {name: ""},
+ TypeCommit: {name: "commit"},
+ TypeTree: {name: "tree"},
+ TypeBlob: {name: "blob"},
+ TypeTag: {name: "tag"},
}
//nolint:gochecknoglobals
diff --git a/object/typ/type_ops.go b/object/typ/type_ops.go
index 82e68147..535c7296 100644
--- a/object/typ/type_ops.go
+++ b/object/typ/type_ops.go
@@ -1,13 +1,5 @@
package typ
-// IsBaseObject reports whether ty is
-// one of the four ordinary Git object types.
-//
-// TODO: This should probably be removed.
-func (ty Type) IsBaseObject() bool {
- return ty.details().isBaseObject
-}
-
// Name returns the canonical Git object type name.
func (ty Type) Name() (string, bool) {
details := ty.details()