MCPcopy Create free account
hub / github.com/go-git/go-git / TestDecodeNonCommit

Method TestDecodeNonCommit

plumbing/object/commit_test.go:34–42  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

32}
33
34func (s *SuiteCommit) TestDecodeNonCommit(c *C) {
35 hash := plumbing.NewHash("9a48f23120e880dfbe41f7c9b7b708e9ee62a492")
36 blob, err := s.Storer.EncodedObject(plumbing.AnyObject, hash)
37 c.Assert(err, IsNil)
38
39 commit := &Commit{}
40 err = commit.Decode(blob)
41 c.Assert(err, Equals, ErrUnsupportedObject)
42}
43
44func (s *SuiteCommit) TestType(c *C) {
45 c.Assert(s.Commit.Type(), Equals, plumbing.CommitObject)

Callers

nothing calls this directly

Calls 3

DecodeMethod · 0.95
NewHashFunction · 0.92
EncodedObjectMethod · 0.65

Tested by

no test coverage detected