(c *C)
| 42 | } |
| 43 | |
| 44 | func (s *StorageSuite) TestCommit(c *C) { |
| 45 | base := memory.NewStorage() |
| 46 | temporal := s.temporal() |
| 47 | st := NewStorage(base, temporal) |
| 48 | |
| 49 | commit := base.NewEncodedObject() |
| 50 | commit.SetType(plumbing.CommitObject) |
| 51 | |
| 52 | _, err := st.SetEncodedObject(commit) |
| 53 | c.Assert(err, IsNil) |
| 54 | |
| 55 | ref := plumbing.NewHashReference("refs/a", commit.Hash()) |
| 56 | c.Assert(st.SetReference(ref), IsNil) |
| 57 | |
| 58 | err = st.Commit() |
| 59 | c.Assert(err, IsNil) |
| 60 | |
| 61 | ref, err = base.Reference(ref.Name()) |
| 62 | c.Assert(err, IsNil) |
| 63 | c.Assert(ref.Hash(), Equals, commit.Hash()) |
| 64 | |
| 65 | obj, err := base.EncodedObject(plumbing.AnyObject, commit.Hash()) |
| 66 | c.Assert(err, IsNil) |
| 67 | c.Assert(obj.Hash(), Equals, commit.Hash()) |
| 68 | } |
| 69 | |
| 70 | func (s *StorageSuite) TestTransactionalPackfileWriter(c *C) { |
| 71 | base := memory.NewStorage() |
nothing calls this directly
no test coverage detected