aboutsummaryrefslogtreecommitdiff
path: root/internal/format
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-11 08:16:48 +0000
committerGravatar Runxi Yu2026-06-11 08:16:48 +0000
commit23ccb471fc2f33a1cc1ce7dd3f07c2265fba04bf (patch)
tree4867fc69b67c87cb55b0f92b5389b989cbd6fcdc /internal/format
parentinternal/cache: Fix package name (diff)
internal/format/packfile: Fix exhaustiveness in entry_type
Diffstat (limited to 'internal/format')
-rw-r--r--internal/format/packfile/entry_type.go7
1 files changed, 4 insertions, 3 deletions
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.