diff options
| author | 2026-06-07 06:01:13 +0000 | |
|---|---|---|
| committer | 2026-06-07 06:01:13 +0000 | |
| commit | cdc65f9e8de256918af833aaee97588861fd6aa5 (patch) | |
| tree | 2e4dbcfa1eb9026b8482b0cd3ec99586a516782c /object | |
| parent | ref/name: Fix error (diff) | |
| signature | No signature | |
*: Refactor file granularity
Diffstat (limited to 'object')
| -rw-r--r-- | object/blob/blob.go | 7 | ||||
| -rw-r--r-- | object/blob/doc.go | 4 | ||||
| -rw-r--r-- | object/commit/commit.go | 6 | ||||
| -rw-r--r-- | object/commit/extraheader.go | 7 | ||||
| -rw-r--r-- | object/signature/signature.go | 9 | ||||
| -rw-r--r-- | object/signature/when.go | 10 |
6 files changed, 21 insertions, 22 deletions
diff --git a/object/blob/blob.go b/object/blob/blob.go index 4ba132d1..793935fe 100644 --- a/object/blob/blob.go +++ b/object/blob/blob.go @@ -1,13 +1,10 @@ -// Package blob provides -// representations, parsers, and serializers -// for blob objects. package blob // Blob represents a Git blob object. // // Blob is fully materialized in memory. -// Consider using objectstore.Reader.ReadReaderContent, -// or appropriate streaming write APIs. +// Consider using [lindenii.org/go/furgit/object/fetch] +// for streaming access, or appropriate streaming write APIs. // // Labels: MT-Unsafe. type Blob struct { diff --git a/object/blob/doc.go b/object/blob/doc.go new file mode 100644 index 00000000..8eea353e --- /dev/null +++ b/object/blob/doc.go @@ -0,0 +1,4 @@ +// Package blob provides +// representations, parsers, and serializers +// for blob objects. +package blob diff --git a/object/commit/commit.go b/object/commit/commit.go index f41366b7..6a89bce9 100644 --- a/object/commit/commit.go +++ b/object/commit/commit.go @@ -17,3 +17,9 @@ type Commit struct { ChangeID string ExtraHeaders []ExtraHeader } + +// ExtraHeader represents an extra header in a Git object. +type ExtraHeader struct { + Key string + Value []byte +} diff --git a/object/commit/extraheader.go b/object/commit/extraheader.go deleted file mode 100644 index 79d4f9cc..00000000 --- a/object/commit/extraheader.go +++ /dev/null @@ -1,7 +0,0 @@ -package commit - -// ExtraHeader represents an extra header in a Git object. -type ExtraHeader struct { - Key string - Value []byte -} diff --git a/object/signature/signature.go b/object/signature/signature.go index e9ec56c0..3d5b911f 100644 --- a/object/signature/signature.go +++ b/object/signature/signature.go @@ -1,5 +1,7 @@ package signature +import "time" + // Signature represents a Git signature (author/committer/tagger). // // Labels: MT-Unsafe. @@ -9,3 +11,10 @@ type Signature struct { WhenUnix int64 OffsetMinutes int32 } + +// When returns a time.Time with the signature's timezone offset. +func (signature Signature) When() time.Time { + loc := time.FixedZone("git", int(signature.OffsetMinutes)*60) + + return time.Unix(signature.WhenUnix, 0).In(loc) +} diff --git a/object/signature/when.go b/object/signature/when.go deleted file mode 100644 index 0a252f68..00000000 --- a/object/signature/when.go +++ /dev/null @@ -1,10 +0,0 @@ -package signature - -import "time" - -// When returns a time.Time with the signature's timezone offset. -func (signature Signature) When() time.Time { - loc := time.FixedZone("git", int(signature.OffsetMinutes)*60) - - return time.Unix(signature.WhenUnix, 0).In(loc) -} |
