aboutsummaryrefslogtreecommitdiff
path: root/object
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-21 12:31:51 +0800
committerGravatar Runxi Yu2026-02-21 12:31:51 +0800
commit2852f9a20613b145fe36a8fde5bfd31ff7e82291 (patch)
tree2df08e4a3f21e0db0f0eacf026bf392d3ba760f7 /object
parenttestgit: Remove old new-repo helpers and use NewRepo with good RepoOptions (diff)
signatureNo signature
*: Use testgit.NewRepo
Diffstat (limited to 'object')
-rw-r--r--object/blob_parse_test.go2
-rw-r--r--object/blob_serialize_test.go2
-rw-r--r--object/commit_parse_test.go2
-rw-r--r--object/commit_serialize_test.go2
-rw-r--r--object/tag_parse_test.go2
-rw-r--r--object/tag_serialize_test.go2
-rw-r--r--object/tree_parse_test.go2
-rw-r--r--object/tree_serialize_test.go2
8 files changed, 8 insertions, 8 deletions
diff --git a/object/blob_parse_test.go b/object/blob_parse_test.go
index ea0a279e..0b8c22ca 100644
--- a/object/blob_parse_test.go
+++ b/object/blob_parse_test.go
@@ -11,7 +11,7 @@ import (
func TestBlobParseFromGit(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
body := []byte("hello\nblob\n")
blobID := testRepo.HashObject(t, "blob", body)
diff --git a/object/blob_serialize_test.go b/object/blob_serialize_test.go
index 4853d980..041851ec 100644
--- a/object/blob_serialize_test.go
+++ b/object/blob_serialize_test.go
@@ -10,7 +10,7 @@ import (
func TestBlobSerialize(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
body := []byte("hello\nblob\n")
wantID := testRepo.HashObject(t, "blob", body)
diff --git a/object/commit_parse_test.go b/object/commit_parse_test.go
index 66061f73..77a570af 100644
--- a/object/commit_parse_test.go
+++ b/object/commit_parse_test.go
@@ -11,7 +11,7 @@ import (
func TestCommitParseFromGit(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
_, treeID, commitID := testRepo.MakeCommit(t, "subject\n\nbody")
rawBody := testRepo.CatFile(t, "commit", commitID)
diff --git a/object/commit_serialize_test.go b/object/commit_serialize_test.go
index 9067d511..6db48143 100644
--- a/object/commit_serialize_test.go
+++ b/object/commit_serialize_test.go
@@ -10,7 +10,7 @@ import (
func TestCommitSerialize(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
_, _, commitID := testRepo.MakeCommit(t, "subject\n\nbody")
rawBody := testRepo.CatFile(t, "commit", commitID)
diff --git a/object/tag_parse_test.go b/object/tag_parse_test.go
index 4131e3f1..0009338e 100644
--- a/object/tag_parse_test.go
+++ b/object/tag_parse_test.go
@@ -12,7 +12,7 @@ import (
func TestTagParseFromGit(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
_, _, commitID := testRepo.MakeCommit(t, "subject\n\nbody")
tagID := testRepo.TagAnnotated(t, "v1", commitID, "tag message")
diff --git a/object/tag_serialize_test.go b/object/tag_serialize_test.go
index 3f1f8b0b..6437977b 100644
--- a/object/tag_serialize_test.go
+++ b/object/tag_serialize_test.go
@@ -10,7 +10,7 @@ import (
func TestTagSerialize(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
_, _, commitID := testRepo.MakeCommit(t, "subject\n\nbody")
tagID := testRepo.TagAnnotated(t, "v1", commitID, "tag message")
diff --git a/object/tree_parse_test.go b/object/tree_parse_test.go
index e1c81d58..f653f068 100644
--- a/object/tree_parse_test.go
+++ b/object/tree_parse_test.go
@@ -11,7 +11,7 @@ import (
func TestTreeParseFromGit(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
entries := adversarialRootEntries(t, testRepo)
inserted := &object.Tree{}
for _, entry := range entries {
diff --git a/object/tree_serialize_test.go b/object/tree_serialize_test.go
index 8e84a67b..f40b13a4 100644
--- a/object/tree_serialize_test.go
+++ b/object/tree_serialize_test.go
@@ -10,7 +10,7 @@ import (
func TestTreeSerialize(t *testing.T) {
testgit.ForEachAlgorithm(t, func(t *testing.T, algo objectid.Algorithm) {
- testRepo := testgit.NewBareRepo(t, algo)
+ testRepo := testgit.NewRepo(t, testgit.RepoOptions{ObjectFormat: algo, Bare: true})
entries := adversarialRootEntries(t, testRepo)
tree := &object.Tree{}