From 43c25d457becb64ed2f76fbe2935475056a1081a Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 16 Nov 2025 00:00:00 +0000 Subject: Documentation overhaul --- obj_commit.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'obj_commit.go') diff --git a/obj_commit.go b/obj_commit.go index c3a4e5db..9953f690 100644 --- a/obj_commit.go +++ b/obj_commit.go @@ -27,7 +27,9 @@ func (sCommit *StoredCommit) Hash() Hash { return sCommit.hash } -// ObjectType allows Commit to satisfy the Object interface. +// ObjectType returns the object type of the commit. +// +// It always returns ObjectTypeCommit. func (commit *Commit) ObjectType() ObjectType { _ = commit return ObjectTypeCommit @@ -128,7 +130,8 @@ func commitBody(c *Commit) ([]byte, error) { return buf.Bytes(), nil } -// Serialize renders a Commit into canonical Git format. +// Serialize renders the commit into its raw byte representation, +// including the header (i.e., "type size\0"). func (commit *Commit) Serialize() ([]byte, error) { body, err := commitBody(commit) if err != nil { -- cgit v1.3.1-10-gc9f91