commit

package
v0.1.171 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package commit provides parsed commit objects and commit serialization.

It parses commits into ordinary Go values for reading and construction. It does not preserve the exact original byte layout needed for signature verification; callers that need signature-verification payload fidelity should use codeberg.org/lindenii/furgit/object/signed/commit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Tree         objectid.ObjectID
	Parents      []objectid.ObjectID
	Author       objectsignature.Signature
	Committer    objectsignature.Signature
	Message      []byte
	ChangeID     string
	ExtraHeaders []ExtraHeader
}

Commit represents a fully materialized Git commit object.

Labels: MT-Unsafe.

func Parse

func Parse(body []byte, algo objectid.Algorithm) (*Commit, error)

Parse decodes a commit object body.

func (*Commit) ObjectType

func (commit *Commit) ObjectType() objecttype.Type

ObjectType returns TypeCommit.

func (*Commit) SerializeWithHeader

func (commit *Commit) SerializeWithHeader() ([]byte, error)

SerializeWithHeader renders the raw object (header + body).

func (*Commit) SerializeWithoutHeader

func (commit *Commit) SerializeWithoutHeader() ([]byte, error)

SerializeWithoutHeader renders the raw commit body bytes.

type ExtraHeader

type ExtraHeader struct {
	Key   string
	Value []byte
}

ExtraHeader represents an extra header in a Git object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL