MCPcopy Create free account
hub / github.com/go-git/go-git / BenchmarkRefMultipleTimes

Function BenchmarkRefMultipleTimes

storage/filesystem/dotgit/dotgit_test.go:195–211  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

193}
194
195func BenchmarkRefMultipleTimes(b *testing.B) {
196 fs := fixtures.Basic().ByTag(".git").One().DotGit()
197 refname := plumbing.ReferenceName("refs/remotes/origin/branch")
198
199 dir := New(fs)
200 _, err := dir.Ref(refname)
201 if err != nil {
202 b.Fatalf("unexpected error: %s", err)
203 }
204
205 for i := 0; i < b.N; i++ {
206 _, err := dir.Ref(refname)
207 if err != nil {
208 b.Fatalf("unexpected error: %s", err)
209 }
210 }
211}
212
213func (s *SuiteDotGit) TestRemoveRefFromReferenceFile(c *C) {
214 fs := fixtures.Basic().ByTag(".git").One().DotGit()

Callers

nothing calls this directly

Calls 3

ReferenceNameTypeAlias · 0.92
RefMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected