From 05e07f6c6aca1662c33359f41c66e6f9b6eb935a Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 20 Feb 2026 21:19:47 +0800 Subject: testgit: Add test harnesses --- internal/testgit/repo_make_commit.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 internal/testgit/repo_make_commit.go (limited to 'internal/testgit/repo_make_commit.go') diff --git a/internal/testgit/repo_make_commit.go b/internal/testgit/repo_make_commit.go new file mode 100644 index 00000000..a329ee8a --- /dev/null +++ b/internal/testgit/repo_make_commit.go @@ -0,0 +1,15 @@ +package testgit + +import ( + "testing" + + "codeberg.org/lindenii/furgit/oid" +) + +// MakeCommit creates a commit over a single-file tree and returns (blobID, treeID, commitID). +func (repo *TestRepo) MakeCommit(tb testing.TB, message string) (oid.ObjectID, oid.ObjectID, oid.ObjectID) { + tb.Helper() + blobID, treeID := repo.MakeSingleFileTree(tb, "file.txt", []byte("commit-body\n")) + commitID := repo.CommitTree(tb, treeID, message) + return blobID, treeID, commitID +} -- cgit v1.3.1-10-gc9f91