aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-14 01:51:59 +0000
committerGravatar Runxi Yu2026-06-14 01:51:59 +0000
commite7156cfb1df3302c333d9e8add3921f280a3d0e1 (patch)
treeae89890a426a5132a99cbfff7bf7977440e95546 /internal/testgit
parentobject/store/packed: Remove extraneous nolint (diff)
*: Preallocate slices
Diffstat (limited to 'internal/testgit')
-rw-r--r--internal/testgit/tree.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/testgit/tree.go b/internal/testgit/tree.go
index 501c7949..ff9b1918 100644
--- a/internal/testgit/tree.go
+++ b/internal/testgit/tree.go
@@ -50,7 +50,7 @@ func (repo *Repo) LsTree(tb testing.TB, oid id.ObjectID) ([]TreeEntry, error) {
return nil, fmt.Errorf("ls-tree: %w", err)
}
- var entries []TreeEntry
+ entries := make([]TreeEntry, 0, bytes.Count(stdout, []byte{0}))
for record := range bytes.SplitSeq(stdout, []byte{0}) {
if len(record) == 0 {