From 94482cb2c97aa215f83940643c5d4c0933727dcb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 13:38:02 +0800 Subject: *: Modernize and lint; add CI --- object/ident.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'object/ident.go') diff --git a/object/ident.go b/object/ident.go index 432a0977..83503c89 100644 --- a/object/ident.go +++ b/object/ident.go @@ -4,10 +4,11 @@ import ( "bytes" "errors" "fmt" - "math" "strconv" "strings" "time" + + "codeberg.org/lindenii/furgit/internal/intconv" ) // Ident represents a Git identity (author/committer/tagger). @@ -76,11 +77,10 @@ func ParseIdent(line []byte) (*Ident, error) { return nil, errors.New("object: ident: invalid timezone minutes range") } total := int64(hh)*60 + int64(mm) - if total > math.MaxInt32 { + offset, err := intconv.Int64ToInt32(total) + if err != nil { return nil, errors.New("object: ident: timezone overflow") } - - offset := int32(total) if sign < 0 { offset = -offset } -- cgit v1.3.1-10-gc9f91