(c *C)
| 368 | } |
| 369 | |
| 370 | func (s *FsSuite) TestPackfileIterKeepDescriptors(c *C) { |
| 371 | fixtures.ByTag(".git").Test(c, func(f *fixtures.Fixture) { |
| 372 | fs := f.DotGit() |
| 373 | ops := dotgit.Options{KeepDescriptors: true} |
| 374 | dg := dotgit.NewWithOptions(fs, ops) |
| 375 | |
| 376 | for _, t := range objectTypes { |
| 377 | ph, err := dg.ObjectPacks() |
| 378 | c.Assert(err, IsNil) |
| 379 | |
| 380 | for _, h := range ph { |
| 381 | f, err := dg.ObjectPack(h) |
| 382 | c.Assert(err, IsNil) |
| 383 | |
| 384 | idxf, err := dg.ObjectPackIdx(h) |
| 385 | c.Assert(err, IsNil) |
| 386 | |
| 387 | iter, err := NewPackfileIter(fs, f, idxf, t, true, 0) |
| 388 | c.Assert(err, IsNil) |
| 389 | |
| 390 | err = iter.ForEach(func(o plumbing.EncodedObject) error { |
| 391 | c.Assert(o.Type(), Equals, t) |
| 392 | return nil |
| 393 | }) |
| 394 | c.Assert(err, IsNil) |
| 395 | |
| 396 | // test twice to check that packfiles are not closed |
| 397 | err = iter.ForEach(func(o plumbing.EncodedObject) error { |
| 398 | c.Assert(o.Type(), Equals, t) |
| 399 | return nil |
| 400 | }) |
| 401 | c.Assert(err, IsNil) |
| 402 | } |
| 403 | } |
| 404 | }) |
| 405 | } |
| 406 | |
| 407 | func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) { |
| 408 | f1 := fixtures.ByTag("worktree").One().DotGit() |
nothing calls this directly
no test coverage detected