From d0f52a812c32bd8227179322947e880a9a966a11 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 6 Jun 2026 21:05:18 +0000 Subject: Various fixes and QoL things --- object/id/object_format_parse.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'object/id/object_format_parse.go') diff --git a/object/id/object_format_parse.go b/object/id/object_format_parse.go index 9e7401c7..521cbd89 100644 --- a/object/id/object_format_parse.go +++ b/object/id/object_format_parse.go @@ -1,8 +1,11 @@ package id // ParseObjectFormat parses a canonical object format name (e.g. "sha1", "sha256"). -func ParseObjectFormat(s string) (ObjectFormat, bool) { +func ParseObjectFormat(s string) (ObjectFormat, error) { objectFormat, ok := objectFormatByName[s] + if !ok { + return ObjectFormatUnknown, ErrInvalidObjectFormat + } - return objectFormat, ok + return objectFormat, nil } -- cgit v1.3.1-10-gc9f91