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

Method TestPatchCancel

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

Source from the content-addressed store, hash-verified

504}
505
506func (s *SuiteCommit) TestPatchCancel(c *C) {
507 from := s.commit(c, plumbing.NewHash("918c48b83bd081e863dbe1b80f8998f058cd8294"))
508 to := s.commit(c, plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5"))
509
510 ctx, cancel := context.WithCancel(context.Background())
511 cancel()
512 patch, err := from.PatchContext(ctx, to)
513 c.Assert(patch, IsNil)
514 c.Assert(err, ErrorMatches, "operation canceled")
515
516}
517
518func (s *SuiteCommit) TestMalformedHeader(c *C) {
519 encoded := &plumbing.MemoryObject{}

Callers

nothing calls this directly

Calls 3

NewHashFunction · 0.92
commitMethod · 0.80
PatchContextMethod · 0.45

Tested by

no test coverage detected