aboutsummaryrefslogtreecommitdiff
path: root/obj_tag.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 /obj_tag.go
parentSeparate stored object types from types that the user is expected to construct. (diff)
signature
Documentation overhaul
Diffstat (limited to 'obj_tag.go')
-rw-r--r--obj_tag.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/obj_tag.go b/obj_tag.go
index 2157e251..d21286c8 100644
--- a/obj_tag.go
+++ b/obj_tag.go
@@ -6,7 +6,7 @@ import (
"fmt"
)
-// Tag represents an annotated Git tag object.
+// Tag represents a Git annotated tag object.
type Tag struct {
Target Hash
TargetType ObjectType
@@ -26,7 +26,9 @@ func (sTag *StoredTag) Hash() Hash {
return sTag.hash
}
-// ObjectType allows Tag to satisfy the Object interface.
+// ObjectType returns the object type of the tag.
+//
+// It always returns ObjectTypeTag.
func (tag *Tag) ObjectType() ObjectType {
_ = tag
return ObjectTypeTag
@@ -142,7 +144,8 @@ func tagBody(t *Tag) ([]byte, error) {
return buf.Bytes(), nil
}
-// Serialize renders a Tag into canonical Git format.
+// Serialize renders the tag into its raw byte representation,
+// including the header (i.e., "type size\0").
func (tag *Tag) Serialize() ([]byte, error) {
body, err := tagBody(tag)
if err != nil {