diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 43c25d457becb64ed2f76fbe2935475056a1081a (patch) | |
| tree | d2cda5f0912ee3cd733aeda626096bd64115eabb /ident.go | |
| parent | Separate 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.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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) |
