aboutsummaryrefslogtreecommitdiff
path: root/object/tree_parse_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-20 22:59:14 +0800
committerGravatar Runxi Yu2026-02-20 22:59:14 +0800
commitd88c8e20aebd9408df0306e97dffc2896950342d (patch)
tree8e137f37fdd9ea673bd622a2b9c9873cd89278fb /object/tree_parse_test.go
parentobjectid: Use _test package for tests (diff)
signatureNo signature
*: Replace repo with testRepo
Diffstat (limited to 'object/tree_parse_test.go')
-rw-r--r--object/tree_parse_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/object/tree_parse_test.go b/object/tree_parse_test.go
index 09c396e3..e1c81d58 100644
--- a/object/tree_parse_test.go
+++ b/object/tree_parse_test.go
@@ -11,8 +11,8 @@ import (
func TestTreeParseFromGit(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- repo := testgit.NewBareRepo(t, algo)
- entries := adversarialRootEntries(t, repo)
+ testRepo := testgit.NewBareRepo(t, algo)
+ entries := adversarialRootEntries(t, testRepo)
inserted := &object.Tree{}
for _, entry := range entries {
if err := inserted.InsertEntry(entry); err != nil {
@@ -20,9 +20,9 @@ func TestTreeParseFromGit(t *testing.T) {
}
}
- treeID := repo.Mktree(t, buildGitMktreeInput(inserted.Entries))
+ treeID := testRepo.Mktree(t, buildGitMktreeInput(inserted.Entries))
- rawBody := repo.CatFile(t, "tree", treeID)
+ rawBody := testRepo.CatFile(t, "tree", treeID)
tree, err := object.ParseTree(rawBody, algo)
if err != nil {
t.Fatalf("ParseTree: %v", err)
@@ -40,7 +40,7 @@ func TestTreeParseFromGit(t *testing.T) {
}
}
- lsNames := gitLsTreeNames(repo.RunBytes(t, "ls-tree", "--name-only", "-z", treeID.String()))
+ lsNames := gitLsTreeNames(testRepo.RunBytes(t, "ls-tree", "--name-only", "-z", treeID.String()))
if len(lsNames) != len(tree.Entries) {
t.Fatalf("ls-tree names = %d, want %d", len(lsNames), len(tree.Entries))
}