(c *C)
| 373 | } |
| 374 | |
| 375 | func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) { |
| 376 | f1 := fixtures.ByTag("worktree").One().DotGit() |
| 377 | f2 := fixtures.ByTag("worktree").ByTag("submodule").One().DotGit() |
| 378 | |
| 379 | ch := cache.NewObjectLRUDefault() |
| 380 | o1 := NewObjectStorage(dotgit.New(f1), ch) |
| 381 | o2 := NewObjectStorage(dotgit.New(f2), ch) |
| 382 | |
| 383 | expected := plumbing.NewHash("af2d6a6954d532f8ffb47615169c8fdf9d383a1a") |
| 384 | obj, err := o1.EncodedObject(plumbing.CommitObject, expected) |
| 385 | c.Assert(err, IsNil) |
| 386 | c.Assert(obj.Hash(), Equals, expected) |
| 387 | |
| 388 | _, err = o2.EncodedObject(plumbing.CommitObject, expected) |
| 389 | c.Assert(err, Equals, plumbing.ErrObjectNotFound) |
| 390 | } |
| 391 | |
| 392 | func (s *FsSuite) TestHashesWithPrefix(c *C) { |
| 393 | // Same setup as TestGetFromObjectFile. |
nothing calls this directly
no test coverage detected