aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/repo_commit_tree.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-21 13:38:02 +0800
committerGravatar Runxi Yu2026-02-21 14:28:15 +0800
commit94482cb2c97aa215f83940643c5d4c0933727dcb (patch)
treebee22fa113542abd1b863ee251fdcf0f9bd409b5 /internal/testgit/repo_commit_tree.go
parentdiff: Add package-level doc comment (diff)
signatureNo signature
*: Modernize and lint; add CI v0.1.17
Diffstat (limited to 'internal/testgit/repo_commit_tree.go')
-rw-r--r--internal/testgit/repo_commit_tree.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/testgit/repo_commit_tree.go b/internal/testgit/repo_commit_tree.go
index f8d78421..763474c2 100644
--- a/internal/testgit/repo_commit_tree.go
+++ b/internal/testgit/repo_commit_tree.go
@@ -9,7 +9,8 @@ import (
// CommitTree creates a commit from a tree and message, optionally with parents.
func (testRepo *TestRepo) CommitTree(tb testing.TB, tree objectid.ObjectID, message string, parents ...objectid.ObjectID) objectid.ObjectID {
tb.Helper()
- args := []string{"commit-tree", tree.String()}
+ args := make([]string, 0, 2+2*len(parents)+2)
+ args = append(args, "commit-tree", tree.String())
for _, p := range parents {
args = append(args, "-p", p.String())
}