aboutsummaryrefslogtreecommitdiff
path: root/object/ident.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-21 13:38:02 +0800
committerGravatar Runxi Yu2026-02-21 14:28:15 +0800
commit94482cb2c97aa215f83940643c5d4c0933727dcb (patch)
treebee22fa113542abd1b863ee251fdcf0f9bd409b5 /object/ident.go
parentdiff: Add package-level doc comment (diff)
signatureNo signature
*: Modernize and lint; add CI v0.1.17
Diffstat (limited to 'object/ident.go')
-rw-r--r--object/ident.go8
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
}