shithub: furgit

ref: c8dd7d3b44c93a664dddc0c4619d336c6e13d2a8
dir: /internal/testgit/repo_make_commit.go/

View raw version
package testgit

import (
	"testing"

	"codeberg.org/lindenii/furgit/objectid"
)

// MakeCommit creates a commit over a single-file tree and returns (blobID, treeID, commitID).
func (testRepo *TestRepo) MakeCommit(tb testing.TB, message string) (objectid.ObjectID, objectid.ObjectID, objectid.ObjectID) {
	tb.Helper()
	blobID, treeID := testRepo.MakeSingleFileTree(tb, "file.txt", []byte("commit-body\n"))
	commitID := testRepo.CommitTree(tb, treeID, message)

	return blobID, treeID, commitID
}