MCPcopy Index your code
hub / github.com/go-git/go-git / TestDecodeNonCommit

Method TestDecodeNonCommit

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

Source from the content-addressed store, hash-verified

33}
34
35func (s *SuiteCommit) TestDecodeNonCommit(c *C) {
36 hash := plumbing.NewHash("9a48f23120e880dfbe41f7c9b7b708e9ee62a492")
37 blob, err := s.Storer.EncodedObject(plumbing.AnyObject, hash)
38 c.Assert(err, IsNil)
39
40 commit := &Commit{}
41 err = commit.Decode(blob)
42 c.Assert(err, Equals, ErrUnsupportedObject)
43}
44
45func (s *SuiteCommit) TestDecodeClearsExistingState(c *C) {
46 const raw = "tree eba74343e2f15d62adedfd8c883ee0262b5c8021\n\nfresh message\n"

Callers

nothing calls this directly

Calls 3

DecodeMethod · 0.95
NewHashFunction · 0.92
EncodedObjectMethod · 0.65

Tested by

no test coverage detected