(c *C)
| 405 | } |
| 406 | |
| 407 | func (s *FsSuite) TestGetFromObjectFileSharedCache(c *C) { |
| 408 | f1 := fixtures.ByTag("worktree").One().DotGit() |
| 409 | f2 := fixtures.ByTag("worktree").ByTag("submodule").One().DotGit() |
| 410 | |
| 411 | ch := cache.NewObjectLRUDefault() |
| 412 | o1 := NewObjectStorage(dotgit.New(f1), ch) |
| 413 | o2 := NewObjectStorage(dotgit.New(f2), ch) |
| 414 | |
| 415 | expected := plumbing.NewHash("af2d6a6954d532f8ffb47615169c8fdf9d383a1a") |
| 416 | obj, err := o1.EncodedObject(plumbing.CommitObject, expected) |
| 417 | c.Assert(err, IsNil) |
| 418 | c.Assert(obj.Hash(), Equals, expected) |
| 419 | |
| 420 | _, err = o2.EncodedObject(plumbing.CommitObject, expected) |
| 421 | c.Assert(err, Equals, plumbing.ErrObjectNotFound) |
| 422 | } |
| 423 | |
| 424 | func (s *FsSuite) TestHashesWithPrefix(c *C) { |
| 425 | // Same setup as TestGetFromObjectFile. |
nothing calls this directly
no test coverage detected