Debian Codegraph @

fixtures_test.go

raw symbols SCIP
1 package fixtures_testscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/
2
3 import (
4 "ioscip-go gomod github.com/golang/go/src go1.25.0 io/"
5 "slicesscip-go gomod github.com/golang/go/src go1.25.0 slices/"
6 "strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/"
7 "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/"
8
9 "github.com/go-git/go-billy/v6/osfsscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/"
10 fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/ "github.com/go-git/go-git-fixtures/v6scip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/"
11 "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/"
12 "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/"
13 )
14
15 func TestDotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestDotGit().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
16 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
17
18 fs, err := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Basicscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Basic().().Onescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#One().().DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithTargetDirscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithTargetDir().(t.TempDirscip-go gomod github.com/golang/go/src go1.25.0 testing/common#TempDir().))
19 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
20
21 files, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Dir#ReadDir().("/")
22 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
23 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Greaterscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Greater().(t, len(files), 1)
24
25 fs, err = fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Basicscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Basic().().Onescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#One().().DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithMemFS().())
26 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
27
28 files, err = fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Dir#ReadDir().("/")
29 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
30 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Greaterscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Greater().(t, len(files), 1)
31 }
32
33 func TestEmbeddedFilesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestEmbeddedFiles().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
34 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
35
36 for i, f := range fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Allscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/All().() {
37 if f.PackfileHashscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#PackfileHash. != "" {
38 file, err := f.Packfilescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Packfile().()
39 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
40 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, file, "failed to get pack file", i)
41
42 if slicesscip-go gomod github.com/golang/go/src go1.25.0 slices/.Containsscip-go gomod github.com/golang/go/src go1.25.0 slices/Contains().(f.Tagsscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Tags., "packfile") {
43 idx, err := f.Idxscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Idx().()
44 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
45 t.Cleanupscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Cleanup().(func() { idx.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().() })
46
47 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, idx, "failed to get idx file", i)
48
49 rev, err := f.Revscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Rev().()
50 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
51 t.Cleanupscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Cleanup().(func() { rev.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().() })
52
53 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, rev, "failed to get rev file", i)
54 }
55 }
56
57 if f.WorktreeHashscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#WorktreeHash. != "" {
58 wt, err := f.Worktreescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Worktree().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithMemFS().())
59 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
60 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, wt, "[mem] failed to get worktree", i)
61
62 wt, err = f.Worktreescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Worktree().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithTargetDirscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithTargetDir().(t.TempDirscip-go gomod github.com/golang/go/src go1.25.0 testing/common#TempDir().))
63 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
64 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, wt, "[tempdir] failed to get worktree", i)
65 }
66
67 if f.DotGitHashscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGitHash. != "" {
68 dot, err := f.DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithMemFS().())
69 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
70 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, dot, "[mem] failed to get dotgit", i)
71
72 dot, err = f.DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithTargetDirscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithTargetDir().(t.TempDirscip-go gomod github.com/golang/go/src go1.25.0 testing/common#TempDir().))
73 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
74 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, dot, "[tempdir] failed to get dotgit", i)
75 }
76 }
77 }
78
79 func TestAllscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestAll().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
80 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
81
82 fs := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Allscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/All().()
83
84 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, fs, 42)
85 }
86
87 func TestByTagscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestByTag().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
88 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
89
90 tests := []struct {
91 tag string
92 len int
93 }{
94 {tag: "packfile", len: 22},
95 {tag: "ofs-delta", len: 3},
96 {tag: ".git", len: 15},
97 {tag: "merge-conflict", len: 1},
98 {tag: "worktree", len: 7},
99 {tag: "submodule", len: 2},
100 {tag: "tags", len: 1},
101 {tag: "notes", len: 1},
102 {tag: "multi-packfile", len: 1},
103 {tag: "diff-tree", len: 7},
104 }
105
106 for _, tc := range tests {
107 t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(tc.tag, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
108 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
109
110 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.ByTagscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/ByTag().(tc.tag)
111 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, f, tc.len)
112 })
113 }
114 }
115
116 func TestByURLscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestByURL().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
117 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
118
119 tests := []struct {
120 URL string
121 len int
122 }{
123 {URL: "https://github.com/git-fixtures/root-references.git", len: 1},
124 {URL: "https://github.com/git-fixtures/basic.git", len: 11},
125 {URL: "https://github.com/git-fixtures/submodule.git", len: 1},
126 {URL: "https://github.com/src-d/go-git.git", len: 1},
127 {URL: "https://github.com/git-fixtures/tags.git", len: 1},
128 {URL: "https://github.com/spinnaker/spinnaker.git", len: 1},
129 {URL: "https://github.com/jamesob/desk.git", len: 1},
130 {URL: "https://github.com/cpcs499/Final_Pres_P.git", len: 1},
131 {URL: "https://github.com/github/gem-builder.git", len: 1},
132 {URL: "https://github.com/githubtraining/example-branches.git", len: 1},
133 {URL: "https://github.com/rumpkernel/rumprun-xen.git", len: 1},
134 {URL: "https://github.com/mcuadros/skeetr.git", len: 1},
135 {URL: "https://github.com/dezfowler/LiteMock.git", len: 1},
136 {URL: "https://github.com/tyba/storable.git", len: 1},
137 {URL: "https://github.com/toqueteos/ts3.git", len: 1},
138 {URL: "https://github.com/git-fixtures/empty.git", len: 1},
139 }
140
141 for _, tc := range tests {
142 t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(tc.URL, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
143 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
144
145 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.ByURLscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/ByURL().(tc.URL)
146 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, f, tc.len)
147 })
148 }
149 }
150
151 func TestIdxscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestIdx().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
152 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
153
154 for i, f := range fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.ByTagscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/ByTag().("packfile") {
155 t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().("#"+strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.Itoascip-go gomod github.com/golang/go/src go1.25.0 strconv/Itoa().(i), func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
156 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
157
158 index, err := f.Idxscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#Idx().()
159 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
160 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, index)
161
162 err = index.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().()
163 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoError().(t, err)
164 })
165 }
166 }
167
168 func TestWithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestWithMemFS().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
169 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
170
171 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Basicscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Basic().().Onescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#One().()
172 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, f)
173
174 fs, err := f.DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithMemFS().())
175 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
176 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, fs)
177
178 files, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Dir#ReadDir().("/")
179 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
180 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotEmptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotEmpty().(t, files)
181
182 stat, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Basic#Stat().("config")
183 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
184 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, stat)
185 }
186
187 func TestWithTargetDirscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestWithTargetDir().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
188 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
189
190 tests := []struct {
191 name string
192 options []osfsscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/.Optionscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/Option#
193 }{
194 {
195 name: "no options",
196 options: nil,
197 },
198 {
199 name: "with bound",
200 options: []osfsscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/.Optionscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/Option#{osfsscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/.WithBoundOSscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6/osfs`/WithBoundOS().()},
201 },
202 }
203
204 for _, tc := range tests {
205 t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(tc.name, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
206 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
207
208 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Basicscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Basic().().Onescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#One().()
209 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, f)
210
211 fs, err := f.DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithTargetDirscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithTargetDir().(t.TempDirscip-go gomod github.com/golang/go/src go1.25.0 testing/common#TempDir()., tc.options...))
212 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
213 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, fs)
214
215 files, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Dir#ReadDir().("/")
216 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
217 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotEmptyscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotEmpty().(t, files)
218
219 stat, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Basic#Stat().("config")
220 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
221 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, stat)
222 })
223 }
224 }
225
226 func TestByObjectFormatscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestByObjectFormat().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
227 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
228
229 tests := []struct {
230 name string
231 objectFormat string
232 tag string
233 expectedLen int
234 }{
235 {
236 name: "sha1",
237 objectFormat: "sha1",
238 expectedLen: 38,
239 },
240 {
241 name: "sha256",
242 objectFormat: "sha256",
243 expectedLen: 4,
244 },
245 {
246 name: "sha1 with .git tag",
247 objectFormat: "sha1",
248 tag: ".git",
249 expectedLen: 13,
250 },
251 {
252 name: "sha256 with .git tag",
253 objectFormat: "sha256",
254 tag: ".git",
255 expectedLen: 2,
256 },
257 {
258 name: "sha1 with packfile tag",
259 objectFormat: "sha1",
260 tag: "packfile",
261 expectedLen: 20,
262 },
263 {
264 name: "sha256 with packfile tag",
265 objectFormat: "sha256",
266 tag: "packfile",
267 expectedLen: 2,
268 },
269 }
270
271 for _, tc := range tests {
272 t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(tc.name, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
273 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
274
275 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.ByObjectFormatscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/ByObjectFormat().(tc.objectFormat)
276
277 if tc.tag != "" {
278 f = f.ByTagscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#ByTag().(tc.tag)
279 }
280
281 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, f, tc.expectedLen)
282 })
283 }
284 }
285
286 func TestEnsureIsBarescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6_test`/TestEnsureIsBare().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
287 t.Parallelscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Parallel().()
288
289 f := fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.Basicscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Basic().().Onescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixtures#One().()
290 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NotNil().(t, f)
291
292 fs, err := f.DotGitscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/Fixture#DotGit().(fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.WithMemFSscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/WithMemFS().())
293 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
294
295 err = fixturesscip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/.EnsureIsBarescip-go gomod github.com/go-git/go-git-fixtures/v6 . `github.com/go-git/go-git-fixtures/v6`/EnsureIsBare().(fs)
296 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
297
298 cfg, err := fs.Openscip-go gomod github.com/go-git/go-billy/v6 v6.0.0-alpha.1 `github.com/go-git/go-billy/v6`/Basic#Open().("config")
299 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
300
301 t.Cleanupscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Cleanup().(func() {
302 cfg.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().()
303 })
304
305 content, err := ioscip-go gomod github.com/golang/go/src go1.25.0 io/.ReadAllscip-go gomod github.com/golang/go/src go1.25.0 io/ReadAll().(cfg)
306 requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err)
307
308 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Containsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Contains().(t, string(content), "bare = true")
309 }