aboutsummaryrefslogtreecommitdiff
path: root/refstore/loose/loose_test.go
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 /refstore/loose/loose_test.go
parenttestgit: Remove old new-repo helpers and use NewRepo with good RepoOptions (diff)
signatureNo signature
*: Use testgit.NewRepo
Diffstat (limited to 'refstore/loose/loose_test.go')
-rw-r--r--refstore/loose/loose_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/refstore/loose/loose_test.go b/refstore/loose/loose_test.go
index 63898721..935b4120 100644
--- a/refstore/loose/loose_test.go
+++ b/refstore/loose/loose_test.go
@@ -31,7 +31,7 @@ func openLooseStore(t *testing.T, repoPath string, algo objectid.Algorithm) *loo
func TestLooseResolveAndResolveFully(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, "loose refs commit")
testRepo.UpdateRef(t, "refs/heads/main", commitID)
testRepo.SymbolicRef(t, "HEAD", "refs/heads/main")
@@ -78,7 +78,7 @@ func TestLooseResolveAndResolveFully(t *testing.T) {
func TestLooseResolveFullyCycle(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})
testRepo.SymbolicRef(t, "refs/heads/a", "refs/heads/b")
testRepo.SymbolicRef(t, "refs/heads/b", "refs/heads/a")
@@ -91,7 +91,7 @@ func TestLooseResolveFullyCycle(t *testing.T) {
func TestLooseListPattern(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, "list refs commit")
testRepo.UpdateRef(t, "refs/heads/main", commitID)
testRepo.UpdateRef(t, "refs/heads/feature", commitID)
@@ -132,7 +132,7 @@ func TestLooseListPattern(t *testing.T) {
func TestLooseMalformedDetachedRef(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})
refPath := filepath.Join(testRepo.Dir(), "refs", "heads", "bad")
if err := os.MkdirAll(filepath.Dir(refPath), 0o755); err != nil {
t.Fatalf("MkdirAll: %v", err)
@@ -150,7 +150,7 @@ func TestLooseMalformedDetachedRef(t *testing.T) {
func TestLooseShorten(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, "shorten refs commit")
testRepo.UpdateRef(t, "refs/heads/main", commitID)
testRepo.UpdateRef(t, "refs/tags/main", commitID)