diff options
| author | 2026-02-21 13:38:02 +0800 | |
|---|---|---|
| committer | 2026-02-21 14:28:15 +0800 | |
| commit | 94482cb2c97aa215f83940643c5d4c0933727dcb (patch) | |
| tree | bee22fa113542abd1b863ee251fdcf0f9bd409b5 /object/ident.go | |
| parent | diff: Add package-level doc comment (diff) | |
| signature | No signature | |
*: Modernize and lint; add CI v0.1.17
Diffstat (limited to 'object/ident.go')
| -rw-r--r-- | object/ident.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 } |
