From 23ccb471fc2f33a1cc1ce7dd3f07c2265fba04bf Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 11 Jun 2026 08:16:48 +0000 Subject: internal/format/packfile: Fix exhaustiveness in entry_type --- internal/format/packfile/entry_type.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/format') diff --git a/internal/format/packfile/entry_type.go b/internal/format/packfile/entry_type.go index 1dbf0ba9..b4baceb4 100644 --- a/internal/format/packfile/entry_type.go +++ b/internal/format/packfile/entry_type.go @@ -45,6 +45,7 @@ func EntryTypeFromObjectType(ty typ.Type) (EntryType, error) { return EntryTypeBlob, nil case typ.Tag: return EntryTypeTag, nil + case typ.Unknown: } return EntryTypeInvalid, ErrUnrepresentableObjectType @@ -61,6 +62,7 @@ func (entryType EntryType) ObjectType() (typ.Type, error) { return typ.Blob, nil case EntryTypeTag: return typ.Tag, nil + case EntryTypeInvalid, EntryTypeFuture, EntryTypeOfsDelta, EntryTypeRefDelta: } return typ.Unknown, ErrInternalEntryType @@ -73,10 +75,9 @@ func (entryType EntryType) IsBase() bool { case EntryTypeCommit, EntryTypeTree, EntryTypeBlob, EntryTypeTag: return true case EntryTypeInvalid, EntryTypeFuture, EntryTypeOfsDelta, EntryTypeRefDelta: - return false - default: - return false } + + return false } // IsDelta reports whether the entry type is a delta type. -- cgit v1.3.1-10-gc9f91