aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/repo_make_commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testgit/repo_make_commit.go')
-rw-r--r--internal/testgit/repo_make_commit.go15
1 files changed, 15 insertions, 0 deletions
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
+}