aboutsummaryrefslogtreecommitdiff
path: root/ident.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-16 00:00:00 +0000
committerGravatar Runxi Yu2025-11-16 00:00:00 +0000
commit43c25d457becb64ed2f76fbe2935475056a1081a (patch)
treed2cda5f0912ee3cd733aeda626096bd64115eabb /ident.go
parentSeparate stored object types from types that the user is expected to construct. (diff)
signature
Documentation overhaul
Diffstat (limited to 'ident.go')
-rw-r--r--ident.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/ident.go b/ident.go
index 5a01d8ea..b5cb38b2 100644
--- a/ident.go
+++ b/ident.go
@@ -10,8 +10,7 @@ import (
"time"
)
-// Ident models an author/committer identity together with its timestamp
-// and timezone offset, mirroring the fields that appear in Git objects.
+// Ident represents a Git identity (author/committer/tagger).
type Ident struct {
Name []byte
Email []byte
@@ -116,7 +115,7 @@ func (ident Ident) Serialize() ([]byte, error) {
return []byte(b.String()), nil
}
-// When returns the timestamp as time.Time using the embedded offset.
+// When returns the ident's time.Time with the correct timezone.
func (ident Ident) When() time.Time {
loc := time.FixedZone("git", int(ident.OffsetMinutes)*60)
return time.Unix(ident.WhenUnix, 0).In(loc)