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

Function BenchmarkRefMultipleTimes

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

Source from the content-addressed store, hash-verified

225}
226
227func BenchmarkRefMultipleTimes(b *testing.B) {
228 fs := fixtures.Basic().ByTag(".git").One().DotGit()
229 refname := plumbing.ReferenceName("refs/remotes/origin/branch")
230
231 dir := New(fs)
232 _, err := dir.Ref(refname)
233 if err != nil {
234 b.Fatalf("unexpected error: %s", err)
235 }
236
237 for i := 0; i < b.N; i++ {
238 _, err := dir.Ref(refname)
239 if err != nil {
240 b.Fatalf("unexpected error: %s", err)
241 }
242 }
243}
244
245func (s *SuiteDotGit) TestRemoveRefFromReferenceFile(c *C) {
246 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…