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

Method TestPushContext

repository_test.go:1642–1661  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

1640}
1641
1642func (s *RepositorySuite) TestPushContext(c *C) {
1643 url := c.MkDir()
1644
1645 _, err := PlainInit(url, true)
1646 c.Assert(err, IsNil)
1647
1648 _, err = s.Repository.CreateRemote(&config.RemoteConfig{
1649 Name: "foo",
1650 URLs: []string{url},
1651 })
1652 c.Assert(err, IsNil)
1653
1654 ctx, cancel := context.WithCancel(context.Background())
1655 cancel()
1656
1657 err = s.Repository.PushContext(ctx, &PushOptions{
1658 RemoteName: "foo",
1659 })
1660 c.Assert(err, NotNil)
1661}
1662
1663// installPreReceiveHook installs a pre-receive hook in the .git
1664// directory at path which prints message m before exiting

Callers

nothing calls this directly

Calls 3

PlainInitFunction · 0.85
CreateRemoteMethod · 0.80
PushContextMethod · 0.45

Tested by

no test coverage detected