From 503f2f1bbc69be553d04c621c7ec33931cc1f57d Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 16 Nov 2025 00:00:00 +0000 Subject: Add a little bit more of documentation --- obj_commit.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'obj_commit.go') diff --git a/obj_commit.go b/obj_commit.go index 9953f690..524ef7bd 100644 --- a/obj_commit.go +++ b/obj_commit.go @@ -8,11 +8,19 @@ import ( // Commit represents a Git commit object. type Commit struct { - Tree Hash - Parents []Hash - Author Ident - Committer Ident - Message []byte + // Tree represents the tree hash referenced by the commit. + Tree Hash + // Parents represents the parent commit hashes. + // Commits that have 0 parents are root commits. + // Commits that have >= 2 parents are merge commits. + Parents []Hash + // Author represents the author of the commit. + Author Ident + // Committer represents the committer of the commit. + Committer Ident + // Message represents the commit message. + Message []byte + // ExtraHeaders holds any extra headers present in the commit. ExtraHeaders []ExtraHeader } -- cgit v1.3.1-10-gc9f91