(b *testing.B)
| 557 | } |
| 558 | |
| 559 | func BenchmarkGetObjectFromPackfile(b *testing.B) { |
| 560 | defer fixtures.Clean() |
| 561 | |
| 562 | for _, f := range fixtures.Basic() { |
| 563 | b.Run(f.URL, func(b *testing.B) { |
| 564 | fs := f.DotGit() |
| 565 | o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault()) |
| 566 | for i := 0; i < b.N; i++ { |
| 567 | expected := plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 568 | obj, err := o.EncodedObject(plumbing.AnyObject, expected) |
| 569 | if err != nil { |
| 570 | b.Fatal(err) |
| 571 | } |
| 572 | |
| 573 | if obj.Hash() != expected { |
| 574 | b.Errorf("expecting %s, got %s", expected, obj.Hash()) |
| 575 | } |
| 576 | } |
| 577 | }) |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | func (s *FsSuite) TestGetFromUnpackedCachesObjects(c *C) { |
| 582 | fs := fixtures.ByTag(".git").ByTag("unpacked").One().DotGit() |
nothing calls this directly
no test coverage detected
searching dependent graphs…